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

Make version table customizable by dialects #1560

Closed
maver1ck opened this issue Oct 30, 2024 · 9 comments
Closed

Make version table customizable by dialects #1560

maver1ck opened this issue Oct 30, 2024 · 9 comments
Labels
migration environment use case not quite a feature and not quite a bug, something we just didn't think of

Comments

@maver1ck
Copy link
Contributor

Describe the use case
Starrocks is Open-Source, High-Performance Analytical Database.
https://www.starrocks.io

Databases / Backends / Drivers targeted

Starrocks

Example Use
Management of Tables in Starrocks.

Additional context
I will create PR with detailed technical solution.

Have a nice day!

@maver1ck maver1ck added requires triage New issue that requires categorization use case not quite a feature and not quite a bug, something we just didn't think of labels Oct 30, 2024
@zzzeek
Copy link
Member

zzzeek commented Oct 30, 2024

Alembic only includes support for SQLAlchemy's built-in dialects: oracle, postgresql, sqlite, mysql, mssql. To add alembic implementations to third party dialects, you should contribute your PR to that dialect's github repository.

@zzzeek zzzeek closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2024
@maver1ck
Copy link
Contributor Author

maver1ck commented Oct 30, 2024

@zzzeek I understand.
But this query makes this support very difficult to achieve in starrocks dialect because sqlalchemy assumes that version_num is first column in alembic_version table. This change doesn't have any impact on existing behaviour.

@zzzeek
Copy link
Member

zzzeek commented Oct 30, 2024

the alembic_version table has only one column. it is by definition the first column in the table.

@zzzeek
Copy link
Member

zzzeek commented Oct 30, 2024

both statements are identical

>>> from sqlalchemy import table, column
>>> alembic_version = table("alembic_version", column("version_num"))
>>> print(alembic_version.select())
SELECT alembic_version.version_num 
FROM alembic_version
>>> print(alembic_version.select().with_only_columns(alembic_version.c.version_num))
SELECT alembic_version.version_num 
FROM alembic_version

@zzzeek
Copy link
Member

zzzeek commented Oct 30, 2024

this is why, let's open a discussion and step through what's happening

@CaselIT CaselIT removed the requires triage New issue that requires categorization label Oct 30, 2024
@CaselIT
Copy link
Member

CaselIT commented Oct 30, 2024

I think the issue is that they want to use a table that has two columns with an autoincrement id as the first column. Not sure if it's a constraint of starrocks the fact that it requires one such column as the fist one.

@CaselIT CaselIT changed the title Work needed for support for Starrocks database Make version table customizable by dialects Nov 1, 2024
@CaselIT CaselIT reopened this Nov 1, 2024
@sqla-tester
Copy link
Collaborator

Maciek Bryński has proposed a fix for this issue in the main branch:

Add ability to configure alembic_version table in DialectImpl https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5556

@zzzeek
Copy link
Member

zzzeek commented Nov 4, 2024

ok you're released thanks for the patience

@maver1ck
Copy link
Contributor Author

maver1ck commented Nov 5, 2024

Thanks @zzzeek.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migration environment use case not quite a feature and not quite a bug, something we just didn't think of
Projects
None yet
4 participants