reydb 1.3.2__py3-none-any.whl → 1.3.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
reydb/rorm.py
CHANGED
@@ -13,7 +13,12 @@ from typing import Self, Any, Type, Literal, TypeVar, Generic, Final, NoReturn,
|
|
13
13
|
from collections.abc import Callable
|
14
14
|
from functools import wraps as functools_wraps
|
15
15
|
from inspect import iscoroutinefunction as inspect_iscoroutinefunction
|
16
|
-
from pydantic import
|
16
|
+
from pydantic import (
|
17
|
+
ConfigDict as ModelConfig,
|
18
|
+
EmailStr as Email,
|
19
|
+
field_validator as pydantic_field_validator,
|
20
|
+
model_validator as pydantic_model_validator
|
21
|
+
)
|
17
22
|
from sqlalchemy import Column, types, text as sqlalchemy_text
|
18
23
|
from sqlalchemy.orm import SessionTransaction, load_only
|
19
24
|
from sqlalchemy.orm.strategy_options import _AttrType
|
@@ -28,7 +33,12 @@ from sqlmodel import SQLModel, Session, Table
|
|
28
33
|
from sqlmodel.main import SQLModelMetaclass, FieldInfo, default_registry
|
29
34
|
from sqlmodel.ext.asyncio.session import AsyncSession
|
30
35
|
from sqlmodel.sql._expression_select_cls import SelectOfScalar as Select
|
31
|
-
from datetime import
|
36
|
+
from datetime import (
|
37
|
+
datetime as Datetime,
|
38
|
+
date as Date,
|
39
|
+
time as Time,
|
40
|
+
timedelta as Timedelta
|
41
|
+
)
|
32
42
|
from warnings import filterwarnings
|
33
43
|
from reykit.rbase import CallableT, Null, throw, is_instance
|
34
44
|
|
@@ -242,7 +252,7 @@ class DatabaseORMModelField(DatabaseORMBase, FieldInfo):
|
|
242
252
|
- `Callable[[], Any]`: Call function and use return value.
|
243
253
|
name : Call argument name and database field name.
|
244
254
|
- `None`: Same as attribute name.
|
245
|
-
key : Whether the field is primary key.
|
255
|
+
key : Whether the field is primary key. When set multiple field, then is composite Primary Key.
|
246
256
|
key_auto : Whether the field is primary key and automatic increment.
|
247
257
|
not_null : Whether the field is not null constraint.
|
248
258
|
- `Litreal[False]`: When argument `arg_default` is `Null`, then set argument `arg_default` is `None`.
|
@@ -1959,7 +1969,7 @@ Model = DatabaseORMModel
|
|
1959
1969
|
Field = DatabaseORMModelField
|
1960
1970
|
|
1961
1971
|
## Database ORM model config type.
|
1962
|
-
|
1972
|
+
ModelConfig
|
1963
1973
|
|
1964
1974
|
## Database ORM model filed types.
|
1965
1975
|
types = types
|
@@ -1976,8 +1986,9 @@ wrap_validate_model = pydantic_model_validator
|
|
1976
1986
|
## Create decorator of validate database ORM model field.
|
1977
1987
|
wrap_validate_filed = pydantic_field_validator
|
1978
1988
|
|
1979
|
-
##
|
1980
|
-
Datetime
|
1981
|
-
Date
|
1982
|
-
Time
|
1983
|
-
Timedelta
|
1989
|
+
## Other type.
|
1990
|
+
Datetime
|
1991
|
+
Date
|
1992
|
+
Time
|
1993
|
+
Timedelta
|
1994
|
+
Email
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: reydb
|
3
|
-
Version: 1.3.
|
3
|
+
Version: 1.3.3
|
4
4
|
Summary: Database method set.
|
5
5
|
Project-URL: homepage, https://github.com/reyxbo/reydb/
|
6
6
|
Author-email: Rey <reyxbo@163.com>
|
@@ -15,7 +15,7 @@ License-File: LICENSE
|
|
15
15
|
Keywords: async,asynchronous,database,db,orm,rey,reyxbo
|
16
16
|
Requires-Python: >=3.12
|
17
17
|
Requires-Dist: aiomysql
|
18
|
-
Requires-Dist: pydantic
|
18
|
+
Requires-Dist: pydantic[email]
|
19
19
|
Requires-Dist: pymysql
|
20
20
|
Requires-Dist: reykit
|
21
21
|
Requires-Dist: sqlalchemy
|
@@ -9,8 +9,8 @@ reydb/rengine.py,sha256=qkpEsfHleia-bT7DBgERpSlZfszB5mLbRACtG-H2D-s,15640
|
|
9
9
|
reydb/rerror.py,sha256=M7RPXwywLYl5Vew7jfXxUxVnBrM1b_T6V9Izt4B8zI0,14791
|
10
10
|
reydb/rexec.py,sha256=hZe5SRbqo_aTpuB1vI2HXVx1FjtwvKGLRom3uzjTuqI,52949
|
11
11
|
reydb/rinfo.py,sha256=c5otyOikGMVnLFhPbtlgmnFBRR3NMP7xcmMW-LQdaQk,18314
|
12
|
-
reydb/rorm.py,sha256=
|
13
|
-
reydb-1.3.
|
14
|
-
reydb-1.3.
|
15
|
-
reydb-1.3.
|
16
|
-
reydb-1.3.
|
12
|
+
reydb/rorm.py,sha256=q_S80zHRausLMYrajQEDpK7fItuqnTtFs_VrkJGZU8Y,50289
|
13
|
+
reydb-1.3.3.dist-info/METADATA,sha256=tgoOQ1-C6CvudX54Z1ye8EssG1Sg4falfcnB0ifz3O4,1653
|
14
|
+
reydb-1.3.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
15
|
+
reydb-1.3.3.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
16
|
+
reydb-1.3.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|