Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Sequences not handling optional=True #938

Open
1 task done
jobh opened this issue Apr 8, 2024 · 0 comments
Open
1 task done

[Bug]: Sequences not handling optional=True #938

jobh opened this issue Apr 8, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jobh
Copy link

jobh commented Apr 8, 2024

What happened?

The Sequence(..., optional=True) construct instructs sqlalchemy to generate a SERIAL data type instead of an explicit sequence when the underlying database supports it.

duckdb does not support it, but nevertheless SERIAL is generated when optional=true.

Base = declarative_base()
class FakeModel(Base):  # type: ignore
    __tablename__ = "fake"

    id = Column(Integer, Sequence("fakemodel_id_sequence", optional=True), primary_key=True)

sqlalchemy.exc.ProgrammingError: (duckdb.duckdb.CatalogException) Catalog Error: Type with name SERIAL does not exist!
Did you mean "real"?
[SQL: 
CREATE TABLE fake (
        id SERIAL NOT NULL, 
        PRIMARY KEY (id)
)

DuckDB Engine Version

0.11.2

DuckDB Version

0.10.1

SQLAlchemy Version

2.0.29

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jobh jobh added the bug Something isn't working label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants