We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Hello,
When reflecting a duckdb column with an enum datatype, are the enum's values supposed to get populated in the column's type?
If I create a table with an enum type column:
CREATE TYPE color_enum AS ENUM ('red', 'blue', 'green'); CREATE TABLE ducks ( id INTEGER, color color_enum );
When loading this column in sqlalchemy, the columns type is set to an empty Enum type:
>>> from sqlalchemy import create_engine, inspect ... engine = create_engine("duckdb:///db.db") ... inspect(engine).get_columns("ducks") [{'name': 'id', 'type': INTEGER(), 'nullable': True, 'default': None, 'autoincrement': False, 'comment': None}, {'name': 'color', 'type': Enum(), 'nullable': True, 'default': None, 'autoincrement': False, 'comment': None}]
The enum values are readable using the get_enums method:
get_enums
>>> inspect(engine).get_enums() [{'name': 'color_enum', 'schema': 'main', 'visible': True, 'labels': ['red', 'blue', 'green']}]
I was expecting the sqlalchemy column types to be automatically populated with the enum values from the DB.
Thanks!
duckdb_engine==0.11.1
duckdb==0.10.0
SQLAlchemy==2.0.27
No response
The text was updated successfully, but these errors were encountered:
Mause
No branches or pull requests
What happened?
Hello,
When reflecting a duckdb column with an enum datatype, are the enum's values supposed to get populated in the column's type?
If I create a table with an enum type column:
When loading this column in sqlalchemy, the columns type is set to an empty Enum type:
The enum values are readable using the
get_enums
method:I was expecting the sqlalchemy column types to be automatically populated with the enum values from the DB.
Thanks!
DuckDB Engine Version
duckdb_engine==0.11.1
DuckDB Version
duckdb==0.10.0
SQLAlchemy Version
SQLAlchemy==2.0.27
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: