-
Notifications
You must be signed in to change notification settings - Fork 24
Complete Type Mapping #64
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
Conversation
- Add complete list of types.
- Generate types and imports correctly.
|
@rayliverified thanks for opening the PR! Can you check issues in flake8 pipeline? |
|
Looks like it's throwing because it doesn't like the formatting. |
|
@rayliverified repo has pre-commit hooks and inside them exist black formatter - https://github.com/xnuinside/omymodels/blob/main/.pre-commit-config.yaml#L3 |
|
Reformatted |
- Resolve invalid Pydantic variable names by applying a Field alias.
- Use Field alias only when needed.
- Handle Json types correctly.
- Set default value "True/False" instead of "1/0".
- Add `Field(exclude=True)` annotation for generated columns.
- Fix import abstract type mapping through the pydantic types class.
|
@rayliverified I merged your PR and now here is conflicts, also several previous tests are failed in test run |
|
We probably need to work together to get the tests working. I'll work on them once I'm unblocked on the enums. Meanwhile, I'm writing up some documentation on the changes I made and I'll share that with you so you can review. |
|
@rayliverified enums released in version 1.7.0 simple-ddl-parser |
|
@rayliverified need to resolve merge request conflicts (they appear after merging your first PR) |
|
I think the feature set is complete now with the recent changes I pushed
today. Added support for time and date types which need special handling.
Next will be the work on going through the tests.
…On Tue, 1 Oct 2024, 12:28 am Iuliia Volkova, ***@***.***> wrote:
@rayliverified <https://github.com/rayliverified> need to resolve merge
request conflicts (they appear after merging your first PR)
—
Reply to this email directly, view it on GitHub
<#64 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEXZO3QIC6IMG7DZPQEHYKTZZIXJNAVCNFSM6AAAAABOOO7I22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBUHAZDQNZTGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
- Expand datetime_now_check to support more SQL datetime keywords - Add table_prefix/table_suffix parameters for class name customization - Add support for generated columns (GENERATED ALWAYS AS) - Add Field alias support for invalid Python identifiers - Handle Pydantic reserved names (copy, parse_obj, schema, etc.) - Convert boolean defaults 0/1 to False/True - Simplify datetime imports (from datetime import datetime) - Use Any type instead of Json for json/jsonb columns - Improve array type handling - Update tests to match new output format Co-Authored-By: Ray Li <[email protected]> Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Expand datetime_now_check to support more SQL datetime keywords - Add table_prefix/table_suffix parameters for class name customization - Add support for generated columns (GENERATED ALWAYS AS) - Add Field alias support for invalid Python identifiers - Handle Pydantic reserved names (copy, parse_obj, schema, etc.) - Convert boolean defaults 0/1 to False/True - Simplify datetime imports (from datetime import datetime) - Use Any type instead of Json for json/jsonb columns - Improve array type handling - Update tests to match new output format Co-Authored-By: Ray Li <[email protected]>
|
Hi! sorry for ghosting - didn't have any time for open source :/ I will close your PR because I did a lot of changes in codebase - huge refactoring. I made new PR #72 added you as so-author |
- Expand datetime_now_check to support more SQL datetime keywords - Add table_prefix/table_suffix parameters for class name customization - Add support for generated columns (GENERATED ALWAYS AS) - Add Field alias support for invalid Python identifiers - Handle Pydantic reserved names (copy, parse_obj, schema, etc.) - Convert boolean defaults 0/1 to False/True - Simplify datetime imports (from datetime import datetime) - Use Any type instead of Json for json/jsonb columns - Improve array type handling - Update tests to match new output format - Fix flake8 linting issues Co-Authored-By: Ray Li <[email protected]>
- Expand datetime_now_check to support more SQL datetime keywords - Add table_prefix/table_suffix parameters for class name customization - Add support for generated columns (GENERATED ALWAYS AS) - Add Field alias support for invalid Python identifiers - Handle Pydantic reserved names (copy, parse_obj, schema, etc.) - Convert boolean defaults 0/1 to False/True - Simplify datetime imports (from datetime import datetime) - Use Any type instead of Json for json/jsonb columns - Improve array type handling - Update tests to match new output format - Fix flake8 linting issues Co-authored-by: Ray Li <[email protected]>
I've added the complete types for MySQL and PostgreSQL. Correct pydantic types are now generated.