You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues and didn't find my bug already reported there
I have checked that my bug is still present in the latest release
Sqlacodegen version
3.0.0rc5
SQLAlchemy version
2.0.30
RDBMS vendor
PostgreSQL
What happened?
I used sqlacodegen --generator tables to generate my SQLAlchemy tables. But it seems that for Domain it is not working properly.
I have a Domain type that is the following :
Note : I started python & SQLAchemy not long ago
Note 2 : I'll try to create a repo to reproduce this bug
Note 3 : THANK YOU FOR CREATING THIS TOOL 😄 , it is simple and amazing, hopefully one day it will be SQLAlchemy and maintained by it
Database schema for reproducing the bug
CREATEDOMAINpublic.language_tag_type
AStext;
ALTERDOMAINpublic.language_tag_type
ADD CONSTRAINT valid_language_tag CHECK (VALUE ~ '^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$'::text);
CREATETABLEIF NOT EXISTS public."user"
(
id uuid NOT NULL DEFAULT 'gen_random_uuid()',
lang language_tag_type COLLATE pg_catalog."default"NOT NULL,
CONSTRAINT user_pkey PRIMARY KEY (id),
)
The text was updated successfully, but these errors were encountered:
@amacfie I'll try your branch to see if it solve my problem.
In any case, I need to go also deep in this repository. I want to generate these Enums, Domains etc... just once and use a reference instead of having duplicated definition.
Yes, ideally the domain is defined once at the top level then referenced by name in columns. Unfortunately my branch includes the domain expression inline in the columns.
Things to check first
I have searched the existing issues and didn't find my bug already reported there
I have checked that my bug is still present in the latest release
Sqlacodegen version
3.0.0rc5
SQLAlchemy version
2.0.30
RDBMS vendor
PostgreSQL
What happened?
I used
sqlacodegen --generator tables
to generate my SQLAlchemy tables. But it seems that for Domain it is not working properly.I have a Domain type that is the following :
sqlacodegen generates the following line:
The check string is not correctly generated. If think It just needs to call to_string() instead of giving the TextClause object no ?
Related closed PR on SQLAlchemy : sqlalchemy/sqlalchemy@017fd9a
Note : I started python & SQLAchemy not long ago
Note 2 : I'll try to create a repo to reproduce this bug
Note 3 : THANK YOU FOR CREATING THIS TOOL 😄 , it is simple and amazing, hopefully one day it will be SQLAlchemy and maintained by it
Database schema for reproducing the bug
The text was updated successfully, but these errors were encountered: