maleo-database 0.0.5__tar.gz → 0.0.7__tar.gz
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.
- {maleo_database-0.0.5 → maleo_database-0.0.7}/PKG-INFO +6 -6
- {maleo_database-0.0.5 → maleo_database-0.0.7}/maleo_database.egg-info/PKG-INFO +6 -6
- {maleo_database-0.0.5 → maleo_database-0.0.7}/maleo_database.egg-info/requires.txt +5 -5
- {maleo_database-0.0.5 → maleo_database-0.0.7}/pyproject.toml +6 -6
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/managers/__init__.py +4 -28
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/managers/session.py +8 -58
- {maleo_database-0.0.5 → maleo_database-0.0.7}/LICENSE +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/README.md +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/maleo_database.egg-info/SOURCES.txt +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/maleo_database.egg-info/dependency_links.txt +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/maleo_database.egg-info/top_level.txt +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/setup.cfg +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/__init__.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/config/__init__.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/config/additional.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/config/connection.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/config/identifier.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/config/pooling.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/dtos.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/enums.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/managers/client.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/managers/engine.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/orm/__init__.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/orm/base.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/orm/models/__init__.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/orm/models/mixins/__init__.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/orm/models/mixins/identifier.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/orm/models/mixins/status.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/orm/models/mixins/timestamp.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/orm/models/table.py +0 -0
- {maleo_database-0.0.5 → maleo_database-0.0.7}/src/orm/queries.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: maleo-database
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.7
|
4
4
|
Summary: Database package for MaleoSuite
|
5
5
|
Author-email: Agra Bima Yuda <agra@nexmedis.com>
|
6
6
|
License: Proprietary
|
@@ -44,12 +44,12 @@ Requires-Dist: identify>=2.6.13
|
|
44
44
|
Requires-Dist: idna>=3.10
|
45
45
|
Requires-Dist: importlib_metadata>=8.7.0
|
46
46
|
Requires-Dist: maleo-constants>=0.0.6
|
47
|
-
Requires-Dist: maleo-dtos>=0.0.
|
47
|
+
Requires-Dist: maleo-dtos>=0.0.12
|
48
48
|
Requires-Dist: maleo-enums>=0.0.6
|
49
|
-
Requires-Dist: maleo-exceptions>=0.0.
|
50
|
-
Requires-Dist: maleo-logging>=0.0.
|
51
|
-
Requires-Dist: maleo-mixins>=0.0.
|
52
|
-
Requires-Dist: maleo-schemas>=0.0.
|
49
|
+
Requires-Dist: maleo-exceptions>=0.0.13
|
50
|
+
Requires-Dist: maleo-logging>=0.0.6
|
51
|
+
Requires-Dist: maleo-mixins>=0.0.13
|
52
|
+
Requires-Dist: maleo-schemas>=0.0.15
|
53
53
|
Requires-Dist: maleo-types-base>=0.0.2
|
54
54
|
Requires-Dist: maleo-types-controllers>=0.0.1
|
55
55
|
Requires-Dist: maleo-types-enums>=0.0.4
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: maleo-database
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.7
|
4
4
|
Summary: Database package for MaleoSuite
|
5
5
|
Author-email: Agra Bima Yuda <agra@nexmedis.com>
|
6
6
|
License: Proprietary
|
@@ -44,12 +44,12 @@ Requires-Dist: identify>=2.6.13
|
|
44
44
|
Requires-Dist: idna>=3.10
|
45
45
|
Requires-Dist: importlib_metadata>=8.7.0
|
46
46
|
Requires-Dist: maleo-constants>=0.0.6
|
47
|
-
Requires-Dist: maleo-dtos>=0.0.
|
47
|
+
Requires-Dist: maleo-dtos>=0.0.12
|
48
48
|
Requires-Dist: maleo-enums>=0.0.6
|
49
|
-
Requires-Dist: maleo-exceptions>=0.0.
|
50
|
-
Requires-Dist: maleo-logging>=0.0.
|
51
|
-
Requires-Dist: maleo-mixins>=0.0.
|
52
|
-
Requires-Dist: maleo-schemas>=0.0.
|
49
|
+
Requires-Dist: maleo-exceptions>=0.0.13
|
50
|
+
Requires-Dist: maleo-logging>=0.0.6
|
51
|
+
Requires-Dist: maleo-mixins>=0.0.13
|
52
|
+
Requires-Dist: maleo-schemas>=0.0.15
|
53
53
|
Requires-Dist: maleo-types-base>=0.0.2
|
54
54
|
Requires-Dist: maleo-types-controllers>=0.0.1
|
55
55
|
Requires-Dist: maleo-types-enums>=0.0.4
|
@@ -35,12 +35,12 @@ identify>=2.6.13
|
|
35
35
|
idna>=3.10
|
36
36
|
importlib_metadata>=8.7.0
|
37
37
|
maleo-constants>=0.0.6
|
38
|
-
maleo-dtos>=0.0.
|
38
|
+
maleo-dtos>=0.0.12
|
39
39
|
maleo-enums>=0.0.6
|
40
|
-
maleo-exceptions>=0.0.
|
41
|
-
maleo-logging>=0.0.
|
42
|
-
maleo-mixins>=0.0.
|
43
|
-
maleo-schemas>=0.0.
|
40
|
+
maleo-exceptions>=0.0.13
|
41
|
+
maleo-logging>=0.0.6
|
42
|
+
maleo-mixins>=0.0.13
|
43
|
+
maleo-schemas>=0.0.15
|
44
44
|
maleo-types-base>=0.0.2
|
45
45
|
maleo-types-controllers>=0.0.1
|
46
46
|
maleo-types-enums>=0.0.4
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "maleo-database"
|
7
|
-
version = "0.0.
|
7
|
+
version = "0.0.7"
|
8
8
|
description = "Database package for MaleoSuite"
|
9
9
|
authors = [
|
10
10
|
{ name = "Agra Bima Yuda", email = "agra@nexmedis.com" }
|
@@ -50,12 +50,12 @@ dependencies = [
|
|
50
50
|
"idna>=3.10",
|
51
51
|
"importlib_metadata>=8.7.0",
|
52
52
|
"maleo-constants>=0.0.6",
|
53
|
-
"maleo-dtos>=0.0.
|
53
|
+
"maleo-dtos>=0.0.12",
|
54
54
|
"maleo-enums>=0.0.6",
|
55
|
-
"maleo-exceptions>=0.0.
|
56
|
-
"maleo-logging>=0.0.
|
57
|
-
"maleo-mixins>=0.0.
|
58
|
-
"maleo-schemas>=0.0.
|
55
|
+
"maleo-exceptions>=0.0.13",
|
56
|
+
"maleo-logging>=0.0.6",
|
57
|
+
"maleo-mixins>=0.0.13",
|
58
|
+
"maleo-schemas>=0.0.15",
|
59
59
|
"maleo-types-base>=0.0.2",
|
60
60
|
"maleo-types-controllers>=0.0.1",
|
61
61
|
"maleo-types-enums>=0.0.4",
|
@@ -144,19 +144,13 @@ class SQLDatabaseManager(DatabaseManager[SQLConfigT], Generic[SQLConfigT]):
|
|
144
144
|
authentication=authentication,
|
145
145
|
) as session:
|
146
146
|
await session.execute(text("SELECT 1"))
|
147
|
-
completed_at = datetime.now(tz=timezone.utc)
|
148
|
-
operation_timestamp = OperationTimestamp(
|
149
|
-
executed_at=executed_at,
|
150
|
-
completed_at=completed_at,
|
151
|
-
duration=(completed_at - executed_at).total_seconds(),
|
152
|
-
)
|
153
147
|
SuccessfulSystemOperation[
|
154
148
|
Optional[GenericAuthentication], NoDataResponse[None]
|
155
149
|
](
|
156
150
|
service_context=self._service_context,
|
157
151
|
id=operation_id,
|
158
152
|
context=self._operation_context,
|
159
|
-
timestamp=
|
153
|
+
timestamp=OperationTimestamp.completed_now(executed_at),
|
160
154
|
summary="Database connectivity check successful",
|
161
155
|
request_context=request_context,
|
162
156
|
authentication=authentication,
|
@@ -169,18 +163,12 @@ class SQLDatabaseManager(DatabaseManager[SQLConfigT], Generic[SQLConfigT]):
|
|
169
163
|
except MaleoException:
|
170
164
|
return False
|
171
165
|
except Exception as e:
|
172
|
-
completed_at = datetime.now(tz=timezone.utc)
|
173
|
-
operation_timestamp = OperationTimestamp(
|
174
|
-
executed_at=executed_at,
|
175
|
-
completed_at=completed_at,
|
176
|
-
duration=(completed_at - executed_at).total_seconds(),
|
177
|
-
)
|
178
166
|
error = InternalServerError[Optional[GenericAuthentication]](
|
179
167
|
OperationType.SYSTEM,
|
180
168
|
service_context=self._service_context,
|
181
169
|
operation_id=operation_id,
|
182
170
|
operation_context=self._operation_context,
|
183
|
-
operation_timestamp=
|
171
|
+
operation_timestamp=OperationTimestamp.completed_now(executed_at),
|
184
172
|
operation_summary="Unexpected error occured checking database connection",
|
185
173
|
request_context=request_context,
|
186
174
|
authentication=authentication,
|
@@ -217,19 +205,13 @@ class SQLDatabaseManager(DatabaseManager[SQLConfigT], Generic[SQLConfigT]):
|
|
217
205
|
authentication=authentication,
|
218
206
|
) as session:
|
219
207
|
session.execute(text("SELECT 1"))
|
220
|
-
completed_at = datetime.now(tz=timezone.utc)
|
221
|
-
operation_timestamp = OperationTimestamp(
|
222
|
-
executed_at=executed_at,
|
223
|
-
completed_at=completed_at,
|
224
|
-
duration=(completed_at - executed_at).total_seconds(),
|
225
|
-
)
|
226
208
|
SuccessfulSystemOperation[
|
227
209
|
Optional[GenericAuthentication], NoDataResponse[None]
|
228
210
|
](
|
229
211
|
service_context=self._service_context,
|
230
212
|
id=operation_id,
|
231
213
|
context=self._operation_context,
|
232
|
-
timestamp=
|
214
|
+
timestamp=OperationTimestamp.completed_now(executed_at),
|
233
215
|
summary="Database connectivity check successful",
|
234
216
|
request_context=request_context,
|
235
217
|
authentication=authentication,
|
@@ -242,18 +224,12 @@ class SQLDatabaseManager(DatabaseManager[SQLConfigT], Generic[SQLConfigT]):
|
|
242
224
|
except MaleoException:
|
243
225
|
return False
|
244
226
|
except Exception as e:
|
245
|
-
completed_at = datetime.now(tz=timezone.utc)
|
246
|
-
operation_timestamp = OperationTimestamp(
|
247
|
-
executed_at=executed_at,
|
248
|
-
completed_at=completed_at,
|
249
|
-
duration=(completed_at - executed_at).total_seconds(),
|
250
|
-
)
|
251
227
|
error = InternalServerError[Optional[GenericAuthentication]](
|
252
228
|
OperationType.SYSTEM,
|
253
229
|
service_context=self._service_context,
|
254
230
|
operation_id=operation_id,
|
255
231
|
operation_context=self._operation_context,
|
256
|
-
operation_timestamp=
|
232
|
+
operation_timestamp=OperationTimestamp.completed_now(executed_at),
|
257
233
|
operation_summary="Unexpected error occured checking database connection",
|
258
234
|
request_context=request_context,
|
259
235
|
authentication=authentication,
|
@@ -113,19 +113,13 @@ class SessionManager(Generic[SQLConfigT]):
|
|
113
113
|
try:
|
114
114
|
yield session # Provide session
|
115
115
|
await session.commit() # Auto-commit on success
|
116
|
-
completed_at = datetime.now(tz=timezone.utc)
|
117
|
-
operation_timestamp = OperationTimestamp(
|
118
|
-
executed_at=executed_at,
|
119
|
-
completed_at=completed_at,
|
120
|
-
duration=(completed_at - executed_at).total_seconds(),
|
121
|
-
)
|
122
116
|
SuccessfulSystemOperation[
|
123
117
|
Optional[GenericAuthentication], NoDataResponse[None]
|
124
118
|
](
|
125
119
|
service_context=self._service_context,
|
126
120
|
id=operation_id,
|
127
121
|
context=self._operation_context,
|
128
|
-
timestamp=
|
122
|
+
timestamp=OperationTimestamp.completed_now(executed_at),
|
129
123
|
summary="Successfully committed async database transaction",
|
130
124
|
request_context=request_context,
|
131
125
|
authentication=authentication,
|
@@ -136,18 +130,12 @@ class SessionManager(Generic[SQLConfigT]):
|
|
136
130
|
)
|
137
131
|
except SQLAlchemyError as se:
|
138
132
|
await session.rollback() # Rollback on error
|
139
|
-
completed_at = datetime.now(tz=timezone.utc)
|
140
|
-
operation_timestamp = OperationTimestamp(
|
141
|
-
executed_at=executed_at,
|
142
|
-
completed_at=completed_at,
|
143
|
-
duration=(completed_at - executed_at).total_seconds(),
|
144
|
-
)
|
145
133
|
error = DatabaseError[Optional[GenericAuthentication]](
|
146
134
|
OperationType.SYSTEM,
|
147
135
|
service_context=self._service_context,
|
148
136
|
operation_id=operation_id,
|
149
137
|
operation_context=self._operation_context,
|
150
|
-
operation_timestamp=
|
138
|
+
operation_timestamp=OperationTimestamp.completed_now(executed_at),
|
151
139
|
operation_summary="SQLAlchemy error occured while handling async database session",
|
152
140
|
request_context=request_context,
|
153
141
|
authentication=authentication,
|
@@ -165,18 +153,12 @@ class SessionManager(Generic[SQLConfigT]):
|
|
165
153
|
raise error from se
|
166
154
|
except ValidationError as ve:
|
167
155
|
await session.rollback() # Rollback on error
|
168
|
-
completed_at = datetime.now(tz=timezone.utc)
|
169
|
-
operation_timestamp = OperationTimestamp(
|
170
|
-
executed_at=executed_at,
|
171
|
-
completed_at=completed_at,
|
172
|
-
duration=(completed_at - executed_at).total_seconds(),
|
173
|
-
)
|
174
156
|
error = UnprocessableEntity[Optional[GenericAuthentication]](
|
175
157
|
OperationType.SYSTEM,
|
176
158
|
service_context=self._service_context,
|
177
159
|
operation_id=operation_id,
|
178
160
|
operation_context=self._operation_context,
|
179
|
-
operation_timestamp=
|
161
|
+
operation_timestamp=OperationTimestamp.completed_now(executed_at),
|
180
162
|
operation_summary="Validation error occured while handling async database session",
|
181
163
|
request_context=request_context,
|
182
164
|
authentication=authentication,
|
@@ -190,18 +172,12 @@ class SessionManager(Generic[SQLConfigT]):
|
|
190
172
|
raise
|
191
173
|
except Exception as e:
|
192
174
|
await session.rollback() # Rollback on error
|
193
|
-
completed_at = datetime.now(tz=timezone.utc)
|
194
|
-
operation_timestamp = OperationTimestamp(
|
195
|
-
executed_at=executed_at,
|
196
|
-
completed_at=completed_at,
|
197
|
-
duration=(completed_at - executed_at).total_seconds(),
|
198
|
-
)
|
199
175
|
error = InternalServerError[Optional[GenericAuthentication]](
|
200
176
|
OperationType.SYSTEM,
|
201
177
|
service_context=self._service_context,
|
202
178
|
operation_id=operation_id,
|
203
179
|
operation_context=self._operation_context,
|
204
|
-
operation_timestamp=
|
180
|
+
operation_timestamp=OperationTimestamp.completed_now(executed_at),
|
205
181
|
operation_summary="Unexpected error occured while handling async database session",
|
206
182
|
request_context=request_context,
|
207
183
|
authentication=authentication,
|
@@ -219,7 +195,6 @@ class SessionManager(Generic[SQLConfigT]):
|
|
219
195
|
raise error from e
|
220
196
|
finally:
|
221
197
|
await session.close() # Ensure session closes
|
222
|
-
completed_at = datetime.now(tz=timezone.utc)
|
223
198
|
SuccessfulSystemOperation[
|
224
199
|
Optional[GenericAuthentication], NoDataResponse[None]
|
225
200
|
](
|
@@ -268,19 +243,13 @@ class SessionManager(Generic[SQLConfigT]):
|
|
268
243
|
try:
|
269
244
|
yield session # Provide session
|
270
245
|
session.commit() # Auto-commit on success
|
271
|
-
completed_at = datetime.now(tz=timezone.utc)
|
272
|
-
operation_timestamp = OperationTimestamp(
|
273
|
-
executed_at=executed_at,
|
274
|
-
completed_at=completed_at,
|
275
|
-
duration=(completed_at - executed_at).total_seconds(),
|
276
|
-
)
|
277
246
|
SuccessfulSystemOperation[
|
278
247
|
Optional[GenericAuthentication], NoDataResponse[None]
|
279
248
|
](
|
280
249
|
service_context=self._service_context,
|
281
250
|
id=operation_id,
|
282
251
|
context=self._operation_context,
|
283
|
-
timestamp=
|
252
|
+
timestamp=OperationTimestamp.completed_now(executed_at),
|
284
253
|
summary="Successfully committed sync database transaction",
|
285
254
|
request_context=request_context,
|
286
255
|
authentication=authentication,
|
@@ -291,18 +260,12 @@ class SessionManager(Generic[SQLConfigT]):
|
|
291
260
|
)
|
292
261
|
except SQLAlchemyError as se:
|
293
262
|
session.rollback() # Rollback on error
|
294
|
-
completed_at = datetime.now(tz=timezone.utc)
|
295
|
-
operation_timestamp = OperationTimestamp(
|
296
|
-
executed_at=executed_at,
|
297
|
-
completed_at=completed_at,
|
298
|
-
duration=(completed_at - executed_at).total_seconds(),
|
299
|
-
)
|
300
263
|
error = DatabaseError[Optional[GenericAuthentication]](
|
301
264
|
OperationType.SYSTEM,
|
302
265
|
service_context=self._service_context,
|
303
266
|
operation_id=operation_id,
|
304
267
|
operation_context=self._operation_context,
|
305
|
-
operation_timestamp=
|
268
|
+
operation_timestamp=OperationTimestamp.completed_now(executed_at),
|
306
269
|
operation_summary="SQLAlchemy error occured while handling sync database session",
|
307
270
|
request_context=request_context,
|
308
271
|
authentication=authentication,
|
@@ -320,18 +283,12 @@ class SessionManager(Generic[SQLConfigT]):
|
|
320
283
|
raise error from se
|
321
284
|
except ValidationError as ve:
|
322
285
|
session.rollback() # Rollback on error
|
323
|
-
completed_at = datetime.now(tz=timezone.utc)
|
324
|
-
operation_timestamp = OperationTimestamp(
|
325
|
-
executed_at=executed_at,
|
326
|
-
completed_at=completed_at,
|
327
|
-
duration=(completed_at - executed_at).total_seconds(),
|
328
|
-
)
|
329
286
|
error = UnprocessableEntity[Optional[GenericAuthentication]](
|
330
287
|
OperationType.SYSTEM,
|
331
288
|
service_context=self._service_context,
|
332
289
|
operation_id=operation_id,
|
333
290
|
operation_context=self._operation_context,
|
334
|
-
operation_timestamp=
|
291
|
+
operation_timestamp=OperationTimestamp.completed_now(executed_at),
|
335
292
|
operation_summary="Validation error occured while handling sync database session",
|
336
293
|
request_context=request_context,
|
337
294
|
authentication=authentication,
|
@@ -345,18 +302,12 @@ class SessionManager(Generic[SQLConfigT]):
|
|
345
302
|
raise
|
346
303
|
except Exception as e:
|
347
304
|
session.rollback() # Rollback on error
|
348
|
-
completed_at = datetime.now(tz=timezone.utc)
|
349
|
-
operation_timestamp = OperationTimestamp(
|
350
|
-
executed_at=executed_at,
|
351
|
-
completed_at=completed_at,
|
352
|
-
duration=(completed_at - executed_at).total_seconds(),
|
353
|
-
)
|
354
305
|
error = InternalServerError[Optional[GenericAuthentication]](
|
355
306
|
OperationType.SYSTEM,
|
356
307
|
service_context=self._service_context,
|
357
308
|
operation_id=operation_id,
|
358
309
|
operation_context=self._operation_context,
|
359
|
-
operation_timestamp=
|
310
|
+
operation_timestamp=OperationTimestamp.completed_now(executed_at),
|
360
311
|
operation_summary="Unexpected error occured while handling sync database session",
|
361
312
|
request_context=request_context,
|
362
313
|
authentication=authentication,
|
@@ -374,7 +325,6 @@ class SessionManager(Generic[SQLConfigT]):
|
|
374
325
|
raise error from e
|
375
326
|
finally:
|
376
327
|
session.close() # Ensure session closes
|
377
|
-
completed_at = datetime.now(tz=timezone.utc)
|
378
328
|
SuccessfulSystemOperation[
|
379
329
|
Optional[GenericAuthentication], NoDataResponse[None]
|
380
330
|
](
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|