-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
visit_primary_key_constraint() fails table creation with pk and fk #208
Comments
Why do you use foreign keys? ClickHouse doen't have this feature. |
We use graphql, it let us get models with submodels with submodels with etc... from ch database. All was good, while i not start to use our tables (and it's relationships, which use foreign keys) for tables creation for testing. Now, if continue strategy of using current tables, i understood, that i or create tables for tests, or specify a foreign key for the relationship - together they will lead to errors. Totally, with fix in
I thing all will be ok. Show me the code
Code above is One To Many pattern for relationships in sqlalchemy which used for graphql. |
Version 0.2.3 with fix is released. |
Describe the bug
When make sql CREATE query for table with
ForeignKey
andprimary_key
both we can get wrong query, which contains unneeded comma.create_all
gives wrong SQL query:which then fall all table creation in clickhouse by error:
To Reproduce
After create_all, when creating all tables, code create list of strings of constraints in
sqlalchemy.sql.compiller.create_table_constraints()
. That list contains empty string which goes fromvisit_primary_key_constraint()
which for primary key returns''
(empty string):By code from
sqlalchemy.sql.compiller.create_table_constraints()
, line 4507, looks like we need to returnNone
fromvisit_primary_key_constraint()
instead empty string to not to make unneeded coma, change code to:Expected behavior
No comma in sql query.
Versions
The text was updated successfully, but these errors were encountered: