diracx-db 0.0.1a23__py3-none-any.whl → 0.0.1a24__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- diracx/db/exceptions.py +4 -1
- diracx/db/os/utils.py +3 -3
- diracx/db/sql/auth/db.py +9 -9
- diracx/db/sql/auth/schema.py +25 -23
- diracx/db/sql/dummy/db.py +2 -2
- diracx/db/sql/dummy/schema.py +8 -6
- diracx/db/sql/job/db.py +57 -54
- diracx/db/sql/job/schema.py +56 -54
- diracx/db/sql/job_logging/db.py +32 -32
- diracx/db/sql/job_logging/schema.py +12 -8
- diracx/db/sql/pilot_agents/schema.py +24 -22
- diracx/db/sql/sandbox_metadata/db.py +42 -40
- diracx/db/sql/sandbox_metadata/schema.py +5 -3
- diracx/db/sql/task_queue/db.py +3 -3
- diracx/db/sql/task_queue/schema.py +2 -0
- diracx/db/sql/utils/__init__.py +22 -451
- diracx/db/sql/utils/base.py +328 -0
- diracx/db/sql/utils/functions.py +105 -0
- diracx/db/sql/utils/job.py +58 -55
- diracx/db/sql/utils/types.py +43 -0
- {diracx_db-0.0.1a23.dist-info → diracx_db-0.0.1a24.dist-info}/METADATA +2 -2
- diracx_db-0.0.1a24.dist-info/RECORD +39 -0
- {diracx_db-0.0.1a23.dist-info → diracx_db-0.0.1a24.dist-info}/WHEEL +1 -1
- diracx_db-0.0.1a23.dist-info/RECORD +0 -36
- {diracx_db-0.0.1a23.dist-info → diracx_db-0.0.1a24.dist-info}/entry_points.txt +0 -0
- {diracx_db-0.0.1a23.dist-info → diracx_db-0.0.1a24.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from functools import partial
|
4
|
+
|
5
|
+
import sqlalchemy.types as types
|
6
|
+
from sqlalchemy import Column as RawColumn
|
7
|
+
from sqlalchemy import DateTime, Enum
|
8
|
+
|
9
|
+
from .functions import utcnow
|
10
|
+
|
11
|
+
Column: partial[RawColumn] = partial(RawColumn, nullable=False)
|
12
|
+
NullColumn: partial[RawColumn] = partial(RawColumn, nullable=True)
|
13
|
+
DateNowColumn = partial(Column, type_=DateTime(timezone=True), server_default=utcnow())
|
14
|
+
|
15
|
+
|
16
|
+
def EnumColumn(name, enum_type, **kwargs): # noqa: N802
|
17
|
+
return Column(name, Enum(enum_type, native_enum=False, length=16), **kwargs)
|
18
|
+
|
19
|
+
|
20
|
+
class EnumBackedBool(types.TypeDecorator):
|
21
|
+
"""Maps a ``EnumBackedBool()`` column to True/False in Python."""
|
22
|
+
|
23
|
+
impl = types.Enum
|
24
|
+
cache_ok: bool = True
|
25
|
+
|
26
|
+
def __init__(self) -> None:
|
27
|
+
super().__init__("True", "False")
|
28
|
+
|
29
|
+
def process_bind_param(self, value, dialect) -> str:
|
30
|
+
if value is True:
|
31
|
+
return "True"
|
32
|
+
elif value is False:
|
33
|
+
return "False"
|
34
|
+
else:
|
35
|
+
raise NotImplementedError(value, dialect)
|
36
|
+
|
37
|
+
def process_result_value(self, value, dialect) -> bool:
|
38
|
+
if value == "True":
|
39
|
+
return True
|
40
|
+
elif value == "False":
|
41
|
+
return False
|
42
|
+
else:
|
43
|
+
raise NotImplementedError(f"Unknown {value=}")
|
@@ -0,0 +1,39 @@
|
|
1
|
+
diracx/db/__init__.py,sha256=2oeUeVwZq53bo_ZOflEYZsBn7tcR5Tzb2AIu0TAWELM,109
|
2
|
+
diracx/db/__main__.py,sha256=tU4tp3OAClYCiPMxlRj524sZGBx9oy4CoWHd8pMuEEs,1715
|
3
|
+
diracx/db/exceptions.py,sha256=1nn-SZLG-nQwkxbvHjZqXhE5ouzWj1f3qhSda2B4ZEg,83
|
4
|
+
diracx/db/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
+
diracx/db/os/__init__.py,sha256=IZr6z6SefrRvuC8sTC4RmB3_wwOyEt1GzpDuwSMH8O4,112
|
6
|
+
diracx/db/os/job_parameters.py,sha256=Knca19uT2G-5FI7MOFlaOAXeHn4ecPVLIH30TiwhaTw,858
|
7
|
+
diracx/db/os/utils.py,sha256=k4EBCDLzx_P35aTOoFFrYjO7bnyIF_-PRZGlpMk3IAI,11366
|
8
|
+
diracx/db/sql/__init__.py,sha256=JYu0b0IVhoXy3lX2m2r2dmAjsRS7IbECBUMEDvX0Te4,391
|
9
|
+
diracx/db/sql/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
|
+
diracx/db/sql/auth/db.py,sha256=Ma3P6m49wUNM9wcQZWoQu1CsyJF8vvGeirBFuQUaAIY,10202
|
11
|
+
diracx/db/sql/auth/schema.py,sha256=2LZZyuv93-iKzfrarQWcXfl1lxPsF604NFNxnti4yxg,3140
|
12
|
+
diracx/db/sql/dummy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
|
+
diracx/db/sql/dummy/db.py,sha256=whcF02IjFQTwe1l4iTHtCkg2XukEaLHpLeHYNGMuGGw,1645
|
14
|
+
diracx/db/sql/dummy/schema.py,sha256=9zI53pKlzc6qBezsyjkatOQrNZdGCjwgjQ8Iz_pyAXs,789
|
15
|
+
diracx/db/sql/job/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
+
diracx/db/sql/job/db.py,sha256=21J5vvIT6z_kdVxmoQjiZ61pjCvAXJ5tKN25eJyNR6Q,11712
|
17
|
+
diracx/db/sql/job/schema.py,sha256=Rmt5ldVN6Pf4MJHMhiT_Zn-k9LVPBTVivmGlyPKFRZE,4647
|
18
|
+
diracx/db/sql/job_logging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
|
+
diracx/db/sql/job_logging/db.py,sha256=-i_azE67MI95LnXER31USCKioq0l4Q3VJb1oQPdy2Ds,7827
|
20
|
+
diracx/db/sql/job_logging/schema.py,sha256=DyFr_4goxfC453xPJX4OkxTGHtlP_5q8PXpr8bhNQS0,960
|
21
|
+
diracx/db/sql/pilot_agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
|
+
diracx/db/sql/pilot_agents/db.py,sha256=7-cuCbh_KhM0jlybsHMWV-W66bHsPHIVBpbuqwjncj0,1232
|
23
|
+
diracx/db/sql/pilot_agents/schema.py,sha256=KeWnFSpYOTrT3-_rOCFjbjNnPNXKnUZiJVsu4vv5U2U,2149
|
24
|
+
diracx/db/sql/sandbox_metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
|
+
diracx/db/sql/sandbox_metadata/db.py,sha256=wpGPUA1KLrt9B9qJaQGZExnyeREp44jdbW3XkRX_kP0,6410
|
26
|
+
diracx/db/sql/sandbox_metadata/schema.py,sha256=mI-YpH6NneOQ6QiqwIwyJ4afwfoamybSlQpvaISFfPY,1431
|
27
|
+
diracx/db/sql/task_queue/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
28
|
+
diracx/db/sql/task_queue/db.py,sha256=xY8yPpCIwTC5epcyFGxAP8K9sOVybYsgoH2_QH3NHb8,9105
|
29
|
+
diracx/db/sql/task_queue/schema.py,sha256=5efAgvNYRkLlaJ2NzRInRfmVa3tyIzQu2l0oRPy4Kzw,3258
|
30
|
+
diracx/db/sql/utils/__init__.py,sha256=b4lLIYRFVX8PW15ekklzs5OeulA6lNEOfBOJqgIOtYY,529
|
31
|
+
diracx/db/sql/utils/base.py,sha256=zAl8OKnA6zYZt4NOoEZJOk2jt2CW9T3jzAzwYuBuITQ,12359
|
32
|
+
diracx/db/sql/utils/functions.py,sha256=PFA570qkCZQdABxsz2_LBEfYUv8dln3suNHx17PHGS0,2879
|
33
|
+
diracx/db/sql/utils/job.py,sha256=U_y8DZdMGU5NbQF3udA4Yg43HaKhF8YhYa-PhzYmIyI,19592
|
34
|
+
diracx/db/sql/utils/types.py,sha256=yU-tXsu6hFGPsr9ba1n3ZjGPnHQI_06lbpkTeDCWJtg,1287
|
35
|
+
diracx_db-0.0.1a24.dist-info/METADATA,sha256=nhVsc3xAwCXVqib7pO-ZF_X00CfmujvCErwr-taQvfw,688
|
36
|
+
diracx_db-0.0.1a24.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
37
|
+
diracx_db-0.0.1a24.dist-info/entry_points.txt,sha256=YLI4f6640bri8Ud6Jt9WNq79pSTVQAkfUasb9f75fR8,315
|
38
|
+
diracx_db-0.0.1a24.dist-info/top_level.txt,sha256=vJx10tdRlBX3rF2Psgk5jlwVGZNcL3m_7iQWwgPXt-U,7
|
39
|
+
diracx_db-0.0.1a24.dist-info/RECORD,,
|
@@ -1,36 +0,0 @@
|
|
1
|
-
diracx/db/__init__.py,sha256=2oeUeVwZq53bo_ZOflEYZsBn7tcR5Tzb2AIu0TAWELM,109
|
2
|
-
diracx/db/__main__.py,sha256=tU4tp3OAClYCiPMxlRj524sZGBx9oy4CoWHd8pMuEEs,1715
|
3
|
-
diracx/db/exceptions.py,sha256=-LSkEwsvjwU7vXqx-xeLvLKInTRAhjwB7K_AKfQcIH8,41
|
4
|
-
diracx/db/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
diracx/db/os/__init__.py,sha256=IZr6z6SefrRvuC8sTC4RmB3_wwOyEt1GzpDuwSMH8O4,112
|
6
|
-
diracx/db/os/job_parameters.py,sha256=Knca19uT2G-5FI7MOFlaOAXeHn4ecPVLIH30TiwhaTw,858
|
7
|
-
diracx/db/os/utils.py,sha256=9UyhgMqaI8loh8chW2zHW-9JAOtH5YfktC-d-uY5Wnk,11346
|
8
|
-
diracx/db/sql/__init__.py,sha256=JYu0b0IVhoXy3lX2m2r2dmAjsRS7IbECBUMEDvX0Te4,391
|
9
|
-
diracx/db/sql/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
|
-
diracx/db/sql/auth/db.py,sha256=Wi4oeHCL4pPiaysZEx8R0KNk9BDxncAAtOD2qnD-NnY,10206
|
11
|
-
diracx/db/sql/auth/schema.py,sha256=W5whp1ZK_SNt-wxWVRBegmrc9IgqCR1LFY1FWwUlEBs,2828
|
12
|
-
diracx/db/sql/dummy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
|
-
diracx/db/sql/dummy/db.py,sha256=4Xyo7gUh_5b6Q2a_ggJG6e7fCtc9HrP_BRXfKGfqZIs,1642
|
14
|
-
diracx/db/sql/dummy/schema.py,sha256=uEkGDNVZbmJecytkHY1CO-M1MiKxe5w1_h0joJMPC9E,680
|
15
|
-
diracx/db/sql/job/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
-
diracx/db/sql/job/db.py,sha256=54TjRzWBgD2xhM3ljdel399xq8ro4Z0k3c7zWlXXCUI,11616
|
17
|
-
diracx/db/sql/job/schema.py,sha256=w9Ht9LyVK-fB5T9-hYGsqifzneeG2YP123j1-Mx8Xio,4283
|
18
|
-
diracx/db/sql/job_logging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
|
-
diracx/db/sql/job_logging/db.py,sha256=RrvIptxFIVrRETxFgqXvA6OzWlA6i6M21LlSzIQcILc,7787
|
20
|
-
diracx/db/sql/job_logging/schema.py,sha256=dD2arl-6bffeK8INT6tZ1HWEpJuYTx2iNiVzswVXXF8,812
|
21
|
-
diracx/db/sql/pilot_agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
|
-
diracx/db/sql/pilot_agents/db.py,sha256=7-cuCbh_KhM0jlybsHMWV-W66bHsPHIVBpbuqwjncj0,1232
|
23
|
-
diracx/db/sql/pilot_agents/schema.py,sha256=d4sVlhWpMVgHguS-VlDR3zqM0Yj5QVEjon3gBgrr-kk,2091
|
24
|
-
diracx/db/sql/sandbox_metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
|
-
diracx/db/sql/sandbox_metadata/db.py,sha256=ZoiKjs-Rdd4p-kOZOLoUkpP0xGIp0oGjou3D2oP_6GE,6452
|
26
|
-
diracx/db/sql/sandbox_metadata/schema.py,sha256=rngYYkJxBhjETBHGLD1CTipDGe44mRYR0wdaFoAJwp0,1400
|
27
|
-
diracx/db/sql/task_queue/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
28
|
-
diracx/db/sql/task_queue/db.py,sha256=e6yauZO0nWaUVqjqQycH8iPO4wXLXaC82eaIq1K_KI8,9102
|
29
|
-
diracx/db/sql/task_queue/schema.py,sha256=fvzQyCw_xWAOWTLW6Qrp1m-WzEKb0tlYmafoLTbCy1I,3222
|
30
|
-
diracx/db/sql/utils/__init__.py,sha256=fANPhXofb3ghvnOeLXmcK33YiViJFG8gI2C-2AMArEs,15647
|
31
|
-
diracx/db/sql/utils/job.py,sha256=B5l9yVdxf67sNxo3iNmrBrIkY184tx8PjFHPij7tpns,19418
|
32
|
-
diracx_db-0.0.1a23.dist-info/METADATA,sha256=l60dT_mkn_EtQVz4HmyxW4z6CXPiJR3M3fpTA_yO9-o,688
|
33
|
-
diracx_db-0.0.1a23.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
34
|
-
diracx_db-0.0.1a23.dist-info/entry_points.txt,sha256=YLI4f6640bri8Ud6Jt9WNq79pSTVQAkfUasb9f75fR8,315
|
35
|
-
diracx_db-0.0.1a23.dist-info/top_level.txt,sha256=vJx10tdRlBX3rF2Psgk5jlwVGZNcL3m_7iQWwgPXt-U,7
|
36
|
-
diracx_db-0.0.1a23.dist-info/RECORD,,
|
File without changes
|
File without changes
|