reydb 1.2.7__py3-none-any.whl → 1.2.8__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/rbuild.py
CHANGED
@@ -11,6 +11,7 @@
|
|
11
11
|
|
12
12
|
from typing import TypedDict, NotRequired, Literal, Type, TypeVar, Generic
|
13
13
|
from copy import deepcopy
|
14
|
+
from sqlalchemy import UniqueConstraint
|
14
15
|
from reykit.rbase import throw, is_instance
|
15
16
|
from reykit.rstdout import ask
|
16
17
|
|
@@ -2487,7 +2488,7 @@ class DatabaseBuildSuper(DatabaseBase, Generic[DatabaseT]):
|
|
2487
2488
|
if column.autoincrement
|
2488
2489
|
else ' | KEY'
|
2489
2490
|
) + (
|
2490
|
-
f" | DEFAULT
|
2491
|
+
f" | DEFAULT {column.server_default.arg}"
|
2491
2492
|
if column.server_default
|
2492
2493
|
else ''
|
2493
2494
|
) + (
|
@@ -2500,14 +2501,10 @@ class DatabaseBuildSuper(DatabaseBase, Generic[DatabaseT]):
|
|
2500
2501
|
)
|
2501
2502
|
|
2502
2503
|
## Index.
|
2503
|
-
if
|
2504
|
+
if table.indexes:
|
2504
2505
|
text += '\n' + '\n'.join(
|
2505
2506
|
[
|
2506
|
-
(
|
2507
|
-
' UNIQUE'
|
2508
|
-
if index.unique
|
2509
|
-
else ' NORMAL'
|
2510
|
-
) + f' INDEX `{index.name}` : ' + ', '.join(
|
2507
|
+
' NORMAL INDEX: ' + ', '.join(
|
2511
2508
|
[
|
2512
2509
|
f'`{column.name}`'
|
2513
2510
|
for column in index.expressions
|
@@ -2517,6 +2514,24 @@ class DatabaseBuildSuper(DatabaseBase, Generic[DatabaseT]):
|
|
2517
2514
|
]
|
2518
2515
|
)
|
2519
2516
|
|
2517
|
+
## Constraint.
|
2518
|
+
if table.constraints:
|
2519
|
+
text += '\n' + '\n'.join(
|
2520
|
+
[
|
2521
|
+
(
|
2522
|
+
' UNIQUE CONSTRAIN: '
|
2523
|
+
if type(constraint) == UniqueConstraint
|
2524
|
+
else ' PRIMARY KEY CONSTRAIN: '
|
2525
|
+
) + ', '.join(
|
2526
|
+
[
|
2527
|
+
f'`{column.name}`'
|
2528
|
+
for column in constraint.columns
|
2529
|
+
]
|
2530
|
+
)
|
2531
|
+
for constraint in table.constraints
|
2532
|
+
]
|
2533
|
+
)
|
2534
|
+
|
2520
2535
|
return text
|
2521
2536
|
|
2522
2537
|
|
reydb/rorm.py
CHANGED
@@ -166,8 +166,7 @@ class DatabaseORMModelMeta(DatabaseORMBase, SQLModelMetaclass):
|
|
166
166
|
):
|
167
167
|
table: Table = cls.__table__
|
168
168
|
for index in table.indexes:
|
169
|
-
|
170
|
-
index_name = index_name_prefix + '_'.join(
|
169
|
+
index_name = '_'.join(
|
171
170
|
column.key
|
172
171
|
for column in index.expressions
|
173
172
|
)
|
@@ -1,15 +1,15 @@
|
|
1
1
|
reydb/__init__.py,sha256=4mnlkfJfkBfxBpCotVUJ86f4AnT8plqlFbGiH3vZ4PM,550
|
2
2
|
reydb/rall.py,sha256=IxSPGh77xz7ndDC7J8kZ_66Gq_xTAztGtnELUku1Ouw,364
|
3
3
|
reydb/rbase.py,sha256=vx37yV6LlWP89nWAfYyOf0Xm3N_e9eB8z5Mxe-aTEo4,8248
|
4
|
-
reydb/rbuild.py,sha256=
|
4
|
+
reydb/rbuild.py,sha256=0jI0MNl-BIhQtuT_-GeXBPTjG76k9EE3wwEQXGhTJyc,80938
|
5
5
|
reydb/rconfig.py,sha256=B_lwfmMg4V4C_SmuLZi8dqGhb3El3ahxouj1snhS_Ek,19143
|
6
6
|
reydb/rconn.py,sha256=guRaR8N6RuzZzujwaeq7HhKWTizF9SrUBqEAFjfjpoo,6909
|
7
7
|
reydb/rdb.py,sha256=syyqZbEu92NbCj9O6_T6iAv7E46CyfQOC4T8qtPfHNs,14364
|
8
8
|
reydb/rerror.py,sha256=Hqb2CA6sG7yEPDt3UHzqrgdt63BqoWbCzji3mKBIlp0,14864
|
9
9
|
reydb/rexec.py,sha256=djHx311c6mr1IjzNLqnGe-4yr3qNmYGUy4pHQA3WElQ,53042
|
10
10
|
reydb/rinfo.py,sha256=LjrqTA7JJbWJsjXwV-zKpbE1htv-whg6239hoQj4yIU,18151
|
11
|
-
reydb/rorm.py,sha256=
|
12
|
-
reydb-1.2.
|
13
|
-
reydb-1.2.
|
14
|
-
reydb-1.2.
|
15
|
-
reydb-1.2.
|
11
|
+
reydb/rorm.py,sha256=BXRmAaZRrIS6ZprtKRDMUHXtxuaMa6RNC7-_uqARSpo,43650
|
12
|
+
reydb-1.2.8.dist-info/METADATA,sha256=LW49lxiggNPo5NgnLVeKo1Euvi11f3QlrD40falMIOE,1621
|
13
|
+
reydb-1.2.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
14
|
+
reydb-1.2.8.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
15
|
+
reydb-1.2.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|