-
Notifications
You must be signed in to change notification settings - Fork 20
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
Type Issues and Support #62
Comments
@xnuinside Do you have a strategy for handling Enums? |
@rayliverified , hi, about enumerated - it should be generated as Python Enum, I don’t have much time this week, but maybe on weekends I can take a look and fix types. Thanks for opening the issue |
Awesome to hear. |
Mysql types aren't generated correctly.
Should the library be updated to properly parse all SQL types?
All table types
Map table types to Pydantic
id
INT
int
tiny_int_example
TINYINT
int
small_int_example
SMALLINT
int
medium_int_example
MEDIUMINT
int
SMALLINT
.big_int_example
BIGINT
int
decimal_example
DECIMAL(10, 2)
Decimal
Decimal
for precise decimal representation.float_example
FLOAT
float
double_example
DOUBLE
float
date_example
DATE
date
datetime.date
from Python'sdatetime
module.datetime_example
DATETIME
datetime
datetime.datetime
from Python'sdatetime
module.timestamp_example
TIMESTAMP
datetime
datetime.datetime
; consider timezone awareness based on your application needs.time_example
TIME
time
datetime.time
from Python'sdatetime
module.year_example
YEAR
int
date
with only the year component.char_example
CHAR(100)
str
varchar_example
VARCHAR(255)
str
tiny_text_example
TINYTEXT
str
text_example
TEXT
str
medium_text_example
MEDIUMTEXT
str
long_text_example
LONGTEXT
str
binary_example
BINARY(16)
bytes
varbinary_example
VARBINARY(255)
bytes
tiny_blob_example
TINYBLOB
bytes
blob_example
BLOB
bytes
medium_blob_example
MEDIUMBLOB
bytes
long_blob_example
LONGBLOB
bytes
enum_example
ENUM('small', 'medium', 'large')
Enum
orLiteral
Enum
class orLiteral
fromtyping
for constrained string values.set_example
SET('A', 'B', 'C', 'D')
List[str]
orSet[str]
json_example
JSON
dict
orAny
dict
for JSON objects orAny
for more flexibility.boolean_example
TINYINT(1)
bool
0
asFalse
,1
asTrue
).point_example
POINT
tuple
or Custom Model(float, float)
) or a custom model.line_example
LINESTRING
List[tuple]
polygon_example
POLYGON
List[List[tuple]]
Unsupported types
Issues with parsing
Current output
Fixes
The text was updated successfully, but these errors were encountered: