reydb 1.1.49__py3-none-any.whl → 1.1.51__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/__init__.py +1 -0
- reydb/rall.py +1 -0
- reydb/rbuild.py +24 -25
- reydb/rconfig.py +16 -13
- reydb/rconn.py +24 -25
- reydb/rdb.py +65 -44
- reydb/rerror.py +6 -7
- reydb/rexec.py +1 -1
- reydb/rfile.py +7 -9
- reydb/rinfo.py +58 -60
- reydb/rorm.py +567 -0
- reydb/rparam.py +13 -14
- {reydb-1.1.49.dist-info → reydb-1.1.51.dist-info}/METADATA +1 -1
- reydb-1.1.51.dist-info/RECORD +17 -0
- reydb-1.1.49.dist-info/RECORD +0 -16
- {reydb-1.1.49.dist-info → reydb-1.1.51.dist-info}/WHEEL +0 -0
- {reydb-1.1.49.dist-info → reydb-1.1.51.dist-info}/licenses/LICENSE +0 -0
reydb/rorm.py
ADDED
@@ -0,0 +1,567 @@
|
|
1
|
+
# !/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
"""
|
5
|
+
@Time : 2025-09-23 00:50:32
|
6
|
+
@Author : Rey
|
7
|
+
@Contact : reyxbo@163.com
|
8
|
+
@Explain : Database ORM methods.
|
9
|
+
"""
|
10
|
+
|
11
|
+
|
12
|
+
from typing import Self, Any, Type, TypeVar, Generic, Final
|
13
|
+
from functools import wraps as functools_wraps
|
14
|
+
from sqlalchemy.orm import SessionTransaction
|
15
|
+
from sqlalchemy.sql.dml import Insert, Update, Delete
|
16
|
+
from sqlmodel import SQLModel, Session, Field as sqlmodel_Field
|
17
|
+
from sqlmodel.sql._expression_select_cls import SelectOfScalar as Select
|
18
|
+
from reykit.rbase import CallableT, is_instance
|
19
|
+
|
20
|
+
from .rbase import DatabaseBase
|
21
|
+
from .rdb import Database
|
22
|
+
|
23
|
+
|
24
|
+
__all__ = (
|
25
|
+
'DatabaseORMBase',
|
26
|
+
'DatabaseORMModel',
|
27
|
+
'DatabaseORM',
|
28
|
+
'DatabaseORMSession',
|
29
|
+
'DatabaseORMStatement',
|
30
|
+
'DatabaseORMStatementSelect',
|
31
|
+
'DatabaseORMStatementInsert',
|
32
|
+
'DatabaseORMStatementUpdate',
|
33
|
+
'DatabaseORMStatementDelete'
|
34
|
+
)
|
35
|
+
|
36
|
+
|
37
|
+
class DatabaseORMBase(DatabaseBase):
|
38
|
+
"""
|
39
|
+
Database ORM base type.
|
40
|
+
"""
|
41
|
+
|
42
|
+
|
43
|
+
class DatabaseORMModel(DatabaseORMBase, SQLModel):
|
44
|
+
"""
|
45
|
+
Database ORM model type.
|
46
|
+
"""
|
47
|
+
|
48
|
+
|
49
|
+
def copy(self) -> Self:
|
50
|
+
"""
|
51
|
+
Copy self instance to new instance.
|
52
|
+
|
53
|
+
Returns
|
54
|
+
-------
|
55
|
+
New instance.
|
56
|
+
"""
|
57
|
+
|
58
|
+
# Copy.
|
59
|
+
data = self.model_dump()
|
60
|
+
instance = self.__class__(**data)
|
61
|
+
|
62
|
+
return instance
|
63
|
+
|
64
|
+
|
65
|
+
ModelT = TypeVar('ModelT', bound=DatabaseORMModel)
|
66
|
+
|
67
|
+
|
68
|
+
class DatabaseORM(DatabaseORMBase):
|
69
|
+
"""
|
70
|
+
Database ORM type.
|
71
|
+
|
72
|
+
Attributes
|
73
|
+
----------
|
74
|
+
DatabaseModel : Database ORM model type.
|
75
|
+
Field : Factory function of database ORM model field.
|
76
|
+
"""
|
77
|
+
|
78
|
+
Model = DatabaseORMModel
|
79
|
+
Field = sqlmodel_Field
|
80
|
+
|
81
|
+
|
82
|
+
def __init__(self, db: Database) -> None:
|
83
|
+
"""
|
84
|
+
Build instance attributes.
|
85
|
+
|
86
|
+
Parameters
|
87
|
+
----------
|
88
|
+
db: `Database` instance.
|
89
|
+
"""
|
90
|
+
|
91
|
+
# Build.
|
92
|
+
self.db = db
|
93
|
+
|
94
|
+
## Avoid descriptor error.
|
95
|
+
self.Field = sqlmodel_Field
|
96
|
+
|
97
|
+
|
98
|
+
def session(self):
|
99
|
+
"""
|
100
|
+
Build `DataBaseORMSession` instance.
|
101
|
+
|
102
|
+
Returns
|
103
|
+
-------
|
104
|
+
Instance.
|
105
|
+
"""
|
106
|
+
|
107
|
+
# Build.
|
108
|
+
sess = DataBaseORMSession(self)
|
109
|
+
|
110
|
+
return sess
|
111
|
+
|
112
|
+
|
113
|
+
__call__ = session
|
114
|
+
|
115
|
+
|
116
|
+
class DataBaseORMSession(DatabaseORMBase):
|
117
|
+
"""
|
118
|
+
Database ORM session type, based ORM model.
|
119
|
+
"""
|
120
|
+
|
121
|
+
|
122
|
+
def __init__(self, orm: DatabaseORM) -> None:
|
123
|
+
"""
|
124
|
+
Build instance attributes.
|
125
|
+
|
126
|
+
Parameters
|
127
|
+
----------
|
128
|
+
orm : `DatabaseORM` instance.
|
129
|
+
"""
|
130
|
+
|
131
|
+
# Build.
|
132
|
+
self.orm = orm
|
133
|
+
self.session = Session(orm.db.engine)
|
134
|
+
self.begin: SessionTransaction | None = None
|
135
|
+
|
136
|
+
|
137
|
+
def commit(self) -> None:
|
138
|
+
"""
|
139
|
+
Commit cumulative executions.
|
140
|
+
"""
|
141
|
+
|
142
|
+
# Commit.
|
143
|
+
if self.begin is not None:
|
144
|
+
self.begin.commit()
|
145
|
+
self.begin = None
|
146
|
+
|
147
|
+
|
148
|
+
def rollback(self) -> None:
|
149
|
+
"""
|
150
|
+
Rollback cumulative executions.
|
151
|
+
"""
|
152
|
+
|
153
|
+
# Rollback.
|
154
|
+
if self.begin is not None:
|
155
|
+
self.begin.rollback()
|
156
|
+
self.begin = None
|
157
|
+
|
158
|
+
|
159
|
+
def close(self) -> None:
|
160
|
+
"""
|
161
|
+
Close database connection.
|
162
|
+
"""
|
163
|
+
|
164
|
+
# Close.
|
165
|
+
self.session.close()
|
166
|
+
|
167
|
+
|
168
|
+
def __enter__(self) -> Self:
|
169
|
+
"""
|
170
|
+
Enter syntax `with`.
|
171
|
+
|
172
|
+
Returns
|
173
|
+
-------
|
174
|
+
Self.
|
175
|
+
"""
|
176
|
+
|
177
|
+
return self
|
178
|
+
|
179
|
+
|
180
|
+
def __exit__(
|
181
|
+
self,
|
182
|
+
exc_type: type[BaseException] | None,
|
183
|
+
*_
|
184
|
+
) -> None:
|
185
|
+
"""
|
186
|
+
Exit syntax `with`.
|
187
|
+
|
188
|
+
Parameters
|
189
|
+
----------
|
190
|
+
exc_type : Exception type.
|
191
|
+
"""
|
192
|
+
|
193
|
+
# Commit.
|
194
|
+
if exc_type is None:
|
195
|
+
self.commit()
|
196
|
+
|
197
|
+
# Close.
|
198
|
+
else:
|
199
|
+
self.close()
|
200
|
+
|
201
|
+
|
202
|
+
__del__ = close
|
203
|
+
|
204
|
+
|
205
|
+
def wrap_begin(method: CallableT) -> CallableT:
|
206
|
+
"""
|
207
|
+
Decorator, create and store `SessionTransaction` instance.
|
208
|
+
|
209
|
+
Parameters
|
210
|
+
----------
|
211
|
+
method : Method.
|
212
|
+
|
213
|
+
Returns
|
214
|
+
-------
|
215
|
+
Decorated method.
|
216
|
+
"""
|
217
|
+
|
218
|
+
|
219
|
+
# Define.
|
220
|
+
@functools_wraps(method)
|
221
|
+
def wrap(self, *args, **kwargs):
|
222
|
+
|
223
|
+
# Create.
|
224
|
+
if self.begin is None:
|
225
|
+
self.begin = self.session.begin()
|
226
|
+
|
227
|
+
# Execute.
|
228
|
+
result = method(self, *args, **kwargs)
|
229
|
+
|
230
|
+
return result
|
231
|
+
|
232
|
+
|
233
|
+
return wrap
|
234
|
+
|
235
|
+
|
236
|
+
@wrap_begin
|
237
|
+
def get(self, model: Type[ModelT] | ModelT, key: Any | tuple[Any]) -> ModelT | None:
|
238
|
+
"""
|
239
|
+
select records by primary key.
|
240
|
+
|
241
|
+
Parameters
|
242
|
+
----------
|
243
|
+
model : ORM model type or instance.
|
244
|
+
key : Primary key.
|
245
|
+
- `Any`: Single primary key.
|
246
|
+
- `tuple[Any]`: Composite primary key.
|
247
|
+
|
248
|
+
Returns
|
249
|
+
-------
|
250
|
+
With records ORM model instance or null.
|
251
|
+
"""
|
252
|
+
|
253
|
+
# Handle parameter.
|
254
|
+
if is_instance(model):
|
255
|
+
model = type(model)
|
256
|
+
|
257
|
+
# Get.
|
258
|
+
result = self.session.get(model, key)
|
259
|
+
|
260
|
+
return result
|
261
|
+
|
262
|
+
|
263
|
+
@wrap_begin
|
264
|
+
def gets(self, model: Type[ModelT] | ModelT, *keys: Any | tuple[Any]) -> list[ModelT]:
|
265
|
+
"""
|
266
|
+
Select records by primary key sequence.
|
267
|
+
|
268
|
+
Parameters
|
269
|
+
----------
|
270
|
+
model : ORM model type or instance.
|
271
|
+
keys : Primary key sequence.
|
272
|
+
- `Any`: Single primary key.
|
273
|
+
- `tuple[Any]`: Composite primary key.
|
274
|
+
|
275
|
+
Returns
|
276
|
+
-------
|
277
|
+
With records ORM model instance list.
|
278
|
+
"""
|
279
|
+
|
280
|
+
# Handle parameter.
|
281
|
+
if is_instance(model):
|
282
|
+
model = type(model)
|
283
|
+
|
284
|
+
# Get.
|
285
|
+
results = [
|
286
|
+
result
|
287
|
+
for key in keys
|
288
|
+
if (result := self.session.get(model, key)) is not None
|
289
|
+
]
|
290
|
+
|
291
|
+
return results
|
292
|
+
|
293
|
+
|
294
|
+
@wrap_begin
|
295
|
+
def all(self, model: Type[ModelT] | ModelT) -> list[ModelT]:
|
296
|
+
"""
|
297
|
+
Select all records.
|
298
|
+
|
299
|
+
Parameters
|
300
|
+
----------
|
301
|
+
model : ORM model type or instance.
|
302
|
+
|
303
|
+
Returns
|
304
|
+
-------
|
305
|
+
With records ORM model instance list.
|
306
|
+
"""
|
307
|
+
|
308
|
+
# Get.
|
309
|
+
models = self.select(model).execute()
|
310
|
+
|
311
|
+
return models
|
312
|
+
|
313
|
+
|
314
|
+
@wrap_begin
|
315
|
+
def add(self, *models: DatabaseORMModel) -> None:
|
316
|
+
"""
|
317
|
+
Insert records.
|
318
|
+
|
319
|
+
Parameters
|
320
|
+
----------
|
321
|
+
models : ORM model instances.
|
322
|
+
"""
|
323
|
+
|
324
|
+
# Add.
|
325
|
+
self.session.add_all(models)
|
326
|
+
|
327
|
+
|
328
|
+
@wrap_begin
|
329
|
+
def rm(self, *models: DatabaseORMModel) -> None:
|
330
|
+
"""
|
331
|
+
Delete records.
|
332
|
+
|
333
|
+
Parameters
|
334
|
+
----------
|
335
|
+
models : ORM model instances.
|
336
|
+
"""
|
337
|
+
|
338
|
+
# Delete.
|
339
|
+
for model in models:
|
340
|
+
self.session.delete(model)
|
341
|
+
|
342
|
+
|
343
|
+
@wrap_begin
|
344
|
+
def refresh(self, *models: DatabaseORMModel) -> None:
|
345
|
+
"""
|
346
|
+
Refresh records.
|
347
|
+
|
348
|
+
Parameters
|
349
|
+
----------
|
350
|
+
models : ORM model instances.
|
351
|
+
"""
|
352
|
+
|
353
|
+
# Refresh.
|
354
|
+
for model in models:
|
355
|
+
self.session.refresh(model)
|
356
|
+
|
357
|
+
|
358
|
+
@wrap_begin
|
359
|
+
def expire(self, *models: DatabaseORMModel) -> None:
|
360
|
+
"""
|
361
|
+
Mark records to expire, refresh on next call.
|
362
|
+
|
363
|
+
Parameters
|
364
|
+
----------
|
365
|
+
models : ORM model instances.
|
366
|
+
"""
|
367
|
+
|
368
|
+
# Refresh.
|
369
|
+
for model in models:
|
370
|
+
self.session.expire(model)
|
371
|
+
|
372
|
+
|
373
|
+
@wrap_begin
|
374
|
+
def select(self, model: Type[ModelT] | ModelT):
|
375
|
+
"""
|
376
|
+
Build `DatabaseORMSelect` instance.
|
377
|
+
|
378
|
+
Parameters
|
379
|
+
----------
|
380
|
+
model : ORM model instance.
|
381
|
+
|
382
|
+
Returns
|
383
|
+
-------
|
384
|
+
Instance.
|
385
|
+
"""
|
386
|
+
|
387
|
+
# Handle parameter.
|
388
|
+
if is_instance(model):
|
389
|
+
model = type(model)
|
390
|
+
|
391
|
+
# Build.
|
392
|
+
select = DatabaseORMStatementSelect[ModelT](self, model)
|
393
|
+
|
394
|
+
return select
|
395
|
+
|
396
|
+
|
397
|
+
@wrap_begin
|
398
|
+
def insert(self, model: Type[ModelT] | ModelT):
|
399
|
+
"""
|
400
|
+
Build `DatabaseORMInsert` instance.
|
401
|
+
|
402
|
+
Parameters
|
403
|
+
----------
|
404
|
+
model : ORM model instance.
|
405
|
+
|
406
|
+
Returns
|
407
|
+
-------
|
408
|
+
Instance.
|
409
|
+
"""
|
410
|
+
|
411
|
+
# Handle parameter.
|
412
|
+
if is_instance(model):
|
413
|
+
model = type(model)
|
414
|
+
|
415
|
+
# Build.
|
416
|
+
select = DatabaseORMStatementInsert[ModelT](self, model)
|
417
|
+
|
418
|
+
return select
|
419
|
+
|
420
|
+
|
421
|
+
@wrap_begin
|
422
|
+
def update(self, model: Type[ModelT] | ModelT):
|
423
|
+
"""
|
424
|
+
Build `DatabaseORMUpdate` instance.
|
425
|
+
|
426
|
+
Parameters
|
427
|
+
----------
|
428
|
+
model : ORM model instance.
|
429
|
+
|
430
|
+
Returns
|
431
|
+
-------
|
432
|
+
Instance.
|
433
|
+
"""
|
434
|
+
|
435
|
+
# Handle parameter.
|
436
|
+
if is_instance(model):
|
437
|
+
model = type(model)
|
438
|
+
|
439
|
+
# Build.
|
440
|
+
select = DatabaseORMStatementUpdate[ModelT](self, model)
|
441
|
+
|
442
|
+
return select
|
443
|
+
|
444
|
+
|
445
|
+
@wrap_begin
|
446
|
+
def delete(self, model: Type[ModelT] | ModelT):
|
447
|
+
"""
|
448
|
+
Build `DatabaseORMDelete` instance.
|
449
|
+
|
450
|
+
Parameters
|
451
|
+
----------
|
452
|
+
model : ORM model instance.
|
453
|
+
|
454
|
+
Returns
|
455
|
+
-------
|
456
|
+
Instance.
|
457
|
+
"""
|
458
|
+
|
459
|
+
# Handle parameter.
|
460
|
+
if is_instance(model):
|
461
|
+
model = type(model)
|
462
|
+
|
463
|
+
# Build.
|
464
|
+
select = DatabaseORMStatementDelete[ModelT](self, model)
|
465
|
+
|
466
|
+
return select
|
467
|
+
|
468
|
+
|
469
|
+
class DatabaseORMStatement(DatabaseORMBase):
|
470
|
+
"""
|
471
|
+
Database ORM statement type.
|
472
|
+
"""
|
473
|
+
|
474
|
+
|
475
|
+
def __init__(
|
476
|
+
self,
|
477
|
+
sess: DataBaseORMSession,
|
478
|
+
model: Type[ModelT]
|
479
|
+
) -> None:
|
480
|
+
"""
|
481
|
+
Build instance attributes.
|
482
|
+
|
483
|
+
Parameters
|
484
|
+
----------
|
485
|
+
sess : `DataBaseORMSession` instance.
|
486
|
+
model : ORM model instance.
|
487
|
+
"""
|
488
|
+
|
489
|
+
# Build.
|
490
|
+
self.sess = sess
|
491
|
+
self.model = model
|
492
|
+
|
493
|
+
# Init.
|
494
|
+
super().__init__(self.model)
|
495
|
+
|
496
|
+
|
497
|
+
def execute(self) -> None:
|
498
|
+
"""
|
499
|
+
Execute statement.
|
500
|
+
"""
|
501
|
+
|
502
|
+
# Execute.
|
503
|
+
self.sess.session.exec(self)
|
504
|
+
|
505
|
+
|
506
|
+
class DatabaseORMStatementSelect(DatabaseORMStatement, Select, Generic[ModelT]):
|
507
|
+
"""
|
508
|
+
Database ORM `select` statement type.
|
509
|
+
|
510
|
+
Attributes
|
511
|
+
----------
|
512
|
+
inherit_cache : Compatible `Select` type.
|
513
|
+
"""
|
514
|
+
|
515
|
+
inherit_cache: Final = True
|
516
|
+
|
517
|
+
|
518
|
+
def execute(self) -> list[ModelT]:
|
519
|
+
"""
|
520
|
+
Execute self statement.
|
521
|
+
|
522
|
+
Returns
|
523
|
+
-------
|
524
|
+
With records ORM model instance list.
|
525
|
+
"""
|
526
|
+
|
527
|
+
# Execute.
|
528
|
+
result = self.sess.session.exec(self)
|
529
|
+
models = list(result)
|
530
|
+
|
531
|
+
return models
|
532
|
+
|
533
|
+
|
534
|
+
class DatabaseORMStatementInsert(Generic[ModelT], DatabaseORMStatement, Insert):
|
535
|
+
"""
|
536
|
+
Database ORM `insert` statement type.
|
537
|
+
|
538
|
+
Attributes
|
539
|
+
----------
|
540
|
+
inherit_cache : Compatible `Select` type.
|
541
|
+
"""
|
542
|
+
|
543
|
+
inherit_cache: Final = True
|
544
|
+
|
545
|
+
|
546
|
+
class DatabaseORMStatementUpdate(Generic[ModelT], DatabaseORMStatement, Update):
|
547
|
+
"""
|
548
|
+
Database ORM `update` statement type.
|
549
|
+
|
550
|
+
Attributes
|
551
|
+
----------
|
552
|
+
inherit_cache : Compatible `Update` type.
|
553
|
+
"""
|
554
|
+
|
555
|
+
inherit_cache: Final = True
|
556
|
+
|
557
|
+
|
558
|
+
class DatabaseORMStatementDelete(Generic[ModelT], DatabaseORMStatement, Delete):
|
559
|
+
"""
|
560
|
+
Database ORM `delete` statement type.
|
561
|
+
|
562
|
+
Attributes
|
563
|
+
----------
|
564
|
+
inherit_cache : Compatible `Delete` type.
|
565
|
+
"""
|
566
|
+
|
567
|
+
inherit_cache: Final = True
|
reydb/rparam.py
CHANGED
@@ -12,7 +12,6 @@
|
|
12
12
|
from typing import overload
|
13
13
|
|
14
14
|
from .rbase import DatabaseBase
|
15
|
-
from .rconn import DatabaseConnection
|
16
15
|
from .rdb import Database
|
17
16
|
|
18
17
|
|
@@ -32,7 +31,7 @@ class DatabaseParameters(DatabaseBase):
|
|
32
31
|
|
33
32
|
def __init__(
|
34
33
|
self,
|
35
|
-
|
34
|
+
db: Database,
|
36
35
|
global_: bool
|
37
36
|
) -> None:
|
38
37
|
"""
|
@@ -40,12 +39,12 @@ class DatabaseParameters(DatabaseBase):
|
|
40
39
|
|
41
40
|
Parameters
|
42
41
|
----------
|
43
|
-
|
42
|
+
db: `Database` instance.
|
44
43
|
global\\_ : Whether base global.
|
45
44
|
"""
|
46
45
|
|
47
46
|
# Set parameter.
|
48
|
-
self.
|
47
|
+
self.db = db
|
49
48
|
self.global_ = global_
|
50
49
|
|
51
50
|
|
@@ -126,13 +125,13 @@ class DatabaseParametersStatus(DatabaseParameters):
|
|
126
125
|
|
127
126
|
## Dictionary.
|
128
127
|
if key is None:
|
129
|
-
result = self.
|
128
|
+
result = self.db.execute(sql, key=key)
|
130
129
|
status = result.to_dict(val_field=1)
|
131
130
|
|
132
131
|
## Value.
|
133
132
|
else:
|
134
133
|
sql += ' LIKE :key'
|
135
|
-
result = self.
|
134
|
+
result = self.db.execute(sql, key=key)
|
136
135
|
row = result.first()
|
137
136
|
if row is None:
|
138
137
|
status = None
|
@@ -196,13 +195,13 @@ class DatabaseParametersVariable(DatabaseParameters):
|
|
196
195
|
|
197
196
|
## Dictionary.
|
198
197
|
if key is None:
|
199
|
-
result = self.
|
198
|
+
result = self.db.execute(sql, key=key)
|
200
199
|
variables = result.to_dict(val_field=1)
|
201
200
|
|
202
201
|
## Value.
|
203
202
|
else:
|
204
203
|
sql += ' LIKE :key'
|
205
|
-
result = self.
|
204
|
+
result = self.db.execute(sql, key=key)
|
206
205
|
row = result.first()
|
207
206
|
if row is None:
|
208
207
|
variables = None
|
@@ -244,7 +243,7 @@ class DatabaseParametersVariable(DatabaseParameters):
|
|
244
243
|
sql = f'SET {sql_set}'
|
245
244
|
|
246
245
|
# Execute SQL.
|
247
|
-
self.
|
246
|
+
self.db.execute(sql)
|
248
247
|
|
249
248
|
|
250
249
|
class DatabaseParametersPragma(DatabaseParameters):
|
@@ -255,18 +254,18 @@ class DatabaseParametersPragma(DatabaseParameters):
|
|
255
254
|
|
256
255
|
def __init__(
|
257
256
|
self,
|
258
|
-
|
257
|
+
db: Database
|
259
258
|
) -> None:
|
260
259
|
"""
|
261
260
|
Build instance attributes.
|
262
261
|
|
263
262
|
Parameters
|
264
263
|
----------
|
265
|
-
|
264
|
+
db: `Database` instance.
|
266
265
|
"""
|
267
266
|
|
268
267
|
# Set parameter.
|
269
|
-
self.
|
268
|
+
self.db = db
|
270
269
|
|
271
270
|
|
272
271
|
def get(self, key: str) -> str | None:
|
@@ -286,7 +285,7 @@ class DatabaseParametersPragma(DatabaseParameters):
|
|
286
285
|
sql = f'PRAGMA %s' % key
|
287
286
|
|
288
287
|
# Execute SQL.
|
289
|
-
result = self.
|
288
|
+
result = self.db.execute(sql)
|
290
289
|
row = result.first()
|
291
290
|
if row is None:
|
292
291
|
variables = None
|
@@ -320,4 +319,4 @@ class DatabaseParametersPragma(DatabaseParameters):
|
|
320
319
|
sql = ';\n'.join(sql_set_list)
|
321
320
|
|
322
321
|
# Execute SQL.
|
323
|
-
self.
|
322
|
+
self.db.execute(sql)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
reydb/__init__.py,sha256=vwShFPkCDpLTrVGCq1AZgKCGQ8tBBodCxrvrib9ptrs,574
|
2
|
+
reydb/rall.py,sha256=GsXHqvT1k--U53HpDY4SALjIHN8rwgSxeXpJjH5gq2E,409
|
3
|
+
reydb/rbase.py,sha256=A7or663TcrQyq56P813WsV4BlApZIzXOPdZLsT7KwWw,7040
|
4
|
+
reydb/rbuild.py,sha256=6N8aLqCeX8JnOwQstVA2AuM0Rl5kUHx5Enrm2GGcGvo,31852
|
5
|
+
reydb/rconfig.py,sha256=kkqJg68bGZTE3JqH9dF1n-c1shuPJ4O8Bqg7J9Pd2CM,12659
|
6
|
+
reydb/rconn.py,sha256=48c9bkfMsC993RCBsa4Dvca_ysCwNhYU2d1xiULQ6g8,2813
|
7
|
+
reydb/rdb.py,sha256=Ijxja3lb73YmJfzpJBT3bQrqz9rV3TC5w2shQfwj0gQ,12919
|
8
|
+
reydb/rerror.py,sha256=Lsl7UECYdIFYjd9t7RhvNcHdyGStI3gffm8zmkK1DEc,9943
|
9
|
+
reydb/rexec.py,sha256=xROuWRjIj_j5Y2Iq41DhyyeQ7YNYCyv4pTih-7MxIoE,29073
|
10
|
+
reydb/rfile.py,sha256=8HSrlpuslSCcWzjeh2y4Fs7R_qnm3jS_c13CDrKxpaw,15182
|
11
|
+
reydb/rinfo.py,sha256=cQe5AJmPT_OyaXcNHCmYip2NETAKRvvESateR2STcw4,12745
|
12
|
+
reydb/rorm.py,sha256=miv5K73rJ_ut2hrwdX1HjJke8R94U3ns75NxhAig3_M,11605
|
13
|
+
reydb/rparam.py,sha256=six7wwQRKycoscv-AGyQqsPjA4_TZgcGQ_jk7FZytQs,6803
|
14
|
+
reydb-1.1.51.dist-info/METADATA,sha256=kmP4hYYegLCJrFtjs5V6pl5nBxI4fXSSjvlbYMBxXGI,1550
|
15
|
+
reydb-1.1.51.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
16
|
+
reydb-1.1.51.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
17
|
+
reydb-1.1.51.dist-info/RECORD,,
|
reydb-1.1.49.dist-info/RECORD
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
reydb/__init__.py,sha256=SqjJEBMiUMnKkNfmOvw_jprZcj9Edi0jyBKt67xeYUE,544
|
2
|
-
reydb/rall.py,sha256=UWnbtl4oG4YqXyqTMN_5uqE-QqD5nb_-dvarotlTUeU,388
|
3
|
-
reydb/rbase.py,sha256=A7or663TcrQyq56P813WsV4BlApZIzXOPdZLsT7KwWw,7040
|
4
|
-
reydb/rbuild.py,sha256=GafJ8ocDolj8OsvD9EvMZbR7hKb1WpyQv8LuQO4auKg,32083
|
5
|
-
reydb/rconfig.py,sha256=h6L1QFtTcLgUcqzsn35lZfChcVBT0eVBzf5NOqzCUmQ,12721
|
6
|
-
reydb/rconn.py,sha256=IGRiOkk0TzWj-NQ2o6A1FnMqYnDvg2G1Dd-7cA0dpP0,2765
|
7
|
-
reydb/rdb.py,sha256=E6bFLCKI2f4XXatEsfKDRiZOnT42eYnvsJBV5-OyxQY,12600
|
8
|
-
reydb/rerror.py,sha256=UcBU_EuiponHhraU2tqULcip-s5uNRnDmEQIA4IgrYc,10067
|
9
|
-
reydb/rexec.py,sha256=xIUbTULfmMkLBYZTPX6lyN5yob-eg6M7Xir1j3jf6PM,29071
|
10
|
-
reydb/rfile.py,sha256=OjQQRIZI-vZj0kv9Jljm4_kdp0aL005fAoTl0nAiYAg,15343
|
11
|
-
reydb/rinfo.py,sha256=WXuN2sJtI7EK83HceLyoVXewILYtPxo9wDJFg7SQoJ8,13508
|
12
|
-
reydb/rparam.py,sha256=6cnSjNlX54iPS1uxMQdpazPM5XL4J87vVgfL6CIYG3U,7031
|
13
|
-
reydb-1.1.49.dist-info/METADATA,sha256=7Ae3lNDDvWlwHt4iyfsRzXkF-PlOgoEp7KL7k-U5LSg,1550
|
14
|
-
reydb-1.1.49.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
15
|
-
reydb-1.1.49.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
16
|
-
reydb-1.1.49.dist-info/RECORD,,
|
File without changes
|
File without changes
|