Skip to content

Tags: xnuinside/omymodels

Tags

v0.17.0

Toggle v0.17.0's commit message
**v0.17.0**

1. fix character varying type - #59
2. sqlalchemy import removed from generation in sqlmodels if it is not used
3.  = Field() - is not placed in SQLModel if there is no defaults or other settings to the field

v0.16.0

Toggle v0.16.0's commit message
**v0.16.0**

1. Initial SQLModel Support

0.14.0

Toggle 0.14.0's commit message
python 3.11 support

v0.13.0

Toggle v0.13.0's commit message
**v0.13.0**

1. Added argument 'schema_global=' to support SQLAlchemy & Gino different table schemas #41

v0.12.1

Toggle v0.12.1's commit message
**v0.12.1**

1. current_timestamp function processed now same was as "now()" function from ddl

v0.12.0

Toggle v0.12.0's commit message
**v0.12.0**

1. Now named arguments always went after positional. Fix for #35

1. 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 argument `no_auto_snake_case=True` and O!MyModels will do nothing with the table or column names.

v0.11.1

Toggle v0.11.1's commit message
**v0.11.1**

1. added bytes type to pydantic - #31
2. parser version updated to the latest

v0.11.0

Toggle v0.11.0's commit message
**v0.11.0**

1. MSSQL column & tables names in [] now is parsed validly  - #28
2. names like 'users_WorkSchedule' now converted correctly to PascalCase like UsersWorkSchedule

v0.10.0

Toggle v0.10.0's commit message
1. Meta models moved to separate package - https://github.com/xnuinsi…

…de/table-meta

2. `common` module renamed to `from_ddl`, but anyway please use public API as imports from main module:

`from omymodels import create_models` or `from omymodels import convert_models`

1. Fixed bunch of bugs in converter, but it stil in 'beta'.
2. 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.
3. String enums now in any models types will be inherit from (str, Enum)

1. 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

Toggle v0.9.0's commit message
**v0.9.0**

Features:
1. Added beta models converter from one type of models to another.
To use models convertor:

```python
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

2. Now if O!MyModels does not know how to convert type - he just leave it as is.

Fixes:
1. In Dataclass & Pydantic generators now Decimals & Floats converted to float (previously was int).