Releases: xnuinside/omymodels
Releases · xnuinside/omymodels
Added support for current_timestamp
Fixes & possibility to disable snake_case convert
v0.12.0
Fixes
- Now named arguments always went after positional. Fix for #35
New feature:
- Availability to disable auto-name convertion - #36.
Now, if you want to keep names 1-to-1 as in your DDL file, you can set argumentno_auto_snake_case=True
and O!MyModels will do nothing with the table or column names.
0.11.1 - small release with improvements
v0.11.0 MSSQL fixes
v0.11.0
Fixes:
- MSSQL column & tables names in [] now is parsed validly - #28
- names like 'users_WorkSchedule' now converted correctly to PascalCase like UsersWorkSchedule
v0.10.0 - Converter improvements, Enums moved to separate model
Improvements:
- Meta models moved to separate package - https://github.com/xnuinside/table-meta
common
module renamed tofrom_ddl
, but anyway please use public API as imports from main module:
from omymodels import create_models
or from omymodels import convert_models
Fixes:
- Fixed bunch of bugs in converter, but it stil in 'beta'.
- Previously you can generate models if was any tables in ddl. Now you can also generate Enum models if in ddl you have only CREATE TYPE statements.
- String enums now in any models types will be inherit from (str, Enum)
Features:
- Added converter feature to convert one model type to another (excluding SQLAlchemy Core (Tables)).
Now with more tests for supported models, but still in Beta with bucnh of issues.
v0.9.0 - Beta version of Models converter
Features:
- Added beta models converter from one type of models to another.
To use models convertor:
from omymodels import convert_models
models_from = """
class MaterialType(str, Enum):
article = "article"
video = "video"
@dataclass
class Material:
id: int
title: str
description: str
link: str
type: MaterialType
additional_properties: Union[dict, list]
created_at: datetime.datetime
updated_at: datetime.datetime
"""
result = convert_models(models_from, models_type="gino")
print(result)
where models_type
- type of models that you want to get as a result
- Now if O!MyModels does not know how to convert type - he just leave it as is.
Fixes:
- In Dataclass & Pydantic generators now Decimals & Floats converted to float (previously was int).
v0.8.3 - Fixes for dataclasses & refactoring for future code converter feature
v0.8.3
- Added fundamental concept of TableMetaModel - class that unifies metadata parsed from different classes/ORM models types/DDLs to one standard to allow easy way convert one models to another
in next releases it will be used for converter from one type of models to another. - Fixed issue: #18 "NOW() not recognized as now()"
- Fixed issue: #19 "Default value of now() always returns same time, use field for dataclass"