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

Support sequences on TimescaleDB like on PostgreSQL #349

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MRigal
Copy link

@MRigal MRigal commented Nov 21, 2024

Tiny fix, as else sqlacodegen is also working with TimescaleDB and timeseries hypertables

@agronholm
Copy link
Owner

Wait, what? There's a specific dialect for timescaledb despite it just being a postgresql extension?

@MRigal
Copy link
Author

MRigal commented Nov 21, 2024

Not a real official dialect, but using this extension: https://github.com/dorosch/sqlalchemy-timescaledb gives some nice enhanced support for hypertables

@agronholm
Copy link
Owner

Does it improve the output of sqlacodegen when run against a database containing hypertables?

@MRigal
Copy link
Author

MRigal commented Nov 21, 2024

I've just tested, the answer is "no". It probably misses in https://github.com/dorosch/sqlalchemy-timescaledb/blob/master/sqlalchemy_timescaledb/dialect.py additional features that would look for hypertables on some Inspector methods: https://docs.sqlalchemy.org/en/20/core/reflection.html#sqlalchemy.engine.reflection.Inspector

I'm not familiar enough with it to contribute directly, but if you are also interested and point me towards a possible implementation, I could submit a PR for it

@agronholm
Copy link
Owner

Ok, so is there any reason to run sqlacodegen with the timescaledb dialect instead of postgresql then?

@MRigal
Copy link
Author

MRigal commented Nov 21, 2024

No other one than to use the same engine URL as elsewhere in the code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants