reydb 1.1.48__py3-none-any.whl → 1.1.49__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/rbase.py +101 -2
- reydb/rbuild.py +17 -21
- reydb/rconfig.py +9 -14
- reydb/rconn.py +23 -44
- reydb/rdb.py +60 -1422
- reydb/rerror.py +1 -6
- reydb/rexec.py +820 -183
- reydb/rfile.py +3 -8
- reydb/rinfo.py +37 -95
- {reydb-1.1.48.dist-info → reydb-1.1.49.dist-info}/METADATA +1 -1
- reydb-1.1.49.dist-info/RECORD +16 -0
- reydb-1.1.48.dist-info/RECORD +0 -16
- {reydb-1.1.48.dist-info → reydb-1.1.49.dist-info}/WHEEL +0 -0
- {reydb-1.1.48.dist-info → reydb-1.1.49.dist-info}/licenses/LICENSE +0 -0
reydb/rfile.py
CHANGED
@@ -43,11 +43,6 @@ class DatabaseFile(DatabaseBase):
|
|
43
43
|
database : Database or DatabaseConnection instance.
|
44
44
|
"""
|
45
45
|
|
46
|
-
# Check.
|
47
|
-
if database.backend == 'sqlite':
|
48
|
-
text = 'not suitable for SQLite databases'
|
49
|
-
throw(AssertionError, text=text)
|
50
|
-
|
51
46
|
# Build.
|
52
47
|
self.database = database
|
53
48
|
|
@@ -333,7 +328,7 @@ class DatabaseFile(DatabaseBase):
|
|
333
328
|
file_size = len(file_bytes)
|
334
329
|
|
335
330
|
# Exist.
|
336
|
-
exist = conn.
|
331
|
+
exist = conn.execute.exist(
|
337
332
|
(self.db_names['file'], self.db_names['file.data']),
|
338
333
|
'`md5` = :file_md5',
|
339
334
|
file_md5=file_md5
|
@@ -348,7 +343,7 @@ class DatabaseFile(DatabaseBase):
|
|
348
343
|
'size': file_size,
|
349
344
|
'bytes': file_bytes
|
350
345
|
}
|
351
|
-
conn.
|
346
|
+
conn.execute.insert(
|
352
347
|
(self.db_names['file'], self.db_names['file.data']),
|
353
348
|
data,
|
354
349
|
'ignore'
|
@@ -360,7 +355,7 @@ class DatabaseFile(DatabaseBase):
|
|
360
355
|
'name': file_name,
|
361
356
|
'note': note
|
362
357
|
}
|
363
|
-
conn.
|
358
|
+
conn.execute.insert(
|
364
359
|
(self.db_names['file'], self.db_names['file.information']),
|
365
360
|
data
|
366
361
|
)
|
reydb/rinfo.py
CHANGED
@@ -216,16 +216,11 @@ class DatabaseInformationSchema(DatabaseInformation):
|
|
216
216
|
Information table.
|
217
217
|
"""
|
218
218
|
|
219
|
-
# SQLite.
|
220
|
-
if self._rdatabase.backend == 'sqlite':
|
221
|
-
throw(AssertionError, self._rdatabase.drivername)
|
222
|
-
|
223
219
|
# Select.
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
)
|
220
|
+
result = self._rdatabase.execute.select(
|
221
|
+
'information_schema.SCHEMATA',
|
222
|
+
order='`schema_name`'
|
223
|
+
)
|
229
224
|
|
230
225
|
# Convert.
|
231
226
|
info_table = result.to_table()
|
@@ -273,13 +268,6 @@ class DatabaseInformationDatabase(DatabaseInformation):
|
|
273
268
|
database_name : Database name.
|
274
269
|
"""
|
275
270
|
|
276
|
-
# SQLite.
|
277
|
-
if (
|
278
|
-
rdatabase.backend == 'sqlite'
|
279
|
-
and database_name != 'main'
|
280
|
-
):
|
281
|
-
throw(ValueError, database_name)
|
282
|
-
|
283
271
|
# Set parameter.
|
284
272
|
self._rdatabase = rdatabase
|
285
273
|
self._database_name = database_name
|
@@ -294,13 +282,9 @@ class DatabaseInformationDatabase(DatabaseInformation):
|
|
294
282
|
Information attribute dictionary.
|
295
283
|
"""
|
296
284
|
|
297
|
-
# SQLite.
|
298
|
-
if self._rdatabase.backend == 'sqlite':
|
299
|
-
throw(AssertionError, self._rdatabase.drivername)
|
300
|
-
|
301
285
|
# Select.
|
302
286
|
where = '`SCHEMA_NAME` = :database_name'
|
303
|
-
result = self._rdatabase.
|
287
|
+
result = self._rdatabase.execute.select(
|
304
288
|
'information_schema.SCHEMATA',
|
305
289
|
where=where,
|
306
290
|
limit=1,
|
@@ -328,20 +312,13 @@ class DatabaseInformationDatabase(DatabaseInformation):
|
|
328
312
|
"""
|
329
313
|
|
330
314
|
# Select.
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
where = '`TABLE_SCHEMA` = :database_name'
|
339
|
-
result = self._rdatabase.execute_select(
|
340
|
-
'information_schema.TABLES',
|
341
|
-
where=where,
|
342
|
-
order='`TABLE_NAME`',
|
343
|
-
database_name=self._database_name
|
344
|
-
)
|
315
|
+
where = '`TABLE_SCHEMA` = :database_name'
|
316
|
+
result = self._rdatabase.execute.select(
|
317
|
+
'information_schema.TABLES',
|
318
|
+
where=where,
|
319
|
+
order='`TABLE_NAME`',
|
320
|
+
database_name=self._database_name
|
321
|
+
)
|
345
322
|
|
346
323
|
# Convert.
|
347
324
|
info_table = result.to_table()
|
@@ -404,27 +381,14 @@ class DatabaseInformationTable(DatabaseInformation):
|
|
404
381
|
"""
|
405
382
|
|
406
383
|
# Select.
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
where
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
name=self._table_name
|
416
|
-
)
|
417
|
-
|
418
|
-
## Other.
|
419
|
-
else:
|
420
|
-
where = '`TABLE_SCHEMA` = :database_name AND `TABLE_NAME` = :table_name'
|
421
|
-
result = self._rdatabase.execute_select(
|
422
|
-
'information_schema.TABLES',
|
423
|
-
where=where,
|
424
|
-
limit=1,
|
425
|
-
database_name=self._database_name,
|
426
|
-
table_name=self._table_name
|
427
|
-
)
|
384
|
+
where = '`TABLE_SCHEMA` = :database_name AND `TABLE_NAME` = :table_name'
|
385
|
+
result = self._rdatabase.execute.select(
|
386
|
+
'information_schema.TABLES',
|
387
|
+
where=where,
|
388
|
+
limit=1,
|
389
|
+
database_name=self._database_name,
|
390
|
+
table_name=self._table_name
|
391
|
+
)
|
428
392
|
|
429
393
|
# Convert.
|
430
394
|
info_table = result.to_table()
|
@@ -447,22 +411,14 @@ class DatabaseInformationTable(DatabaseInformation):
|
|
447
411
|
"""
|
448
412
|
|
449
413
|
# Select.
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
where = '`TABLE_SCHEMA` = :database_name AND `TABLE_NAME` = :table_name'
|
459
|
-
result = self._rdatabase.execute_select(
|
460
|
-
'information_schema.COLUMNS',
|
461
|
-
where=where,
|
462
|
-
order='`ORDINAL_POSITION`',
|
463
|
-
database_name=self._database_name,
|
464
|
-
table_name=self._table_name
|
465
|
-
)
|
414
|
+
where = '`TABLE_SCHEMA` = :database_name AND `TABLE_NAME` = :table_name'
|
415
|
+
result = self._rdatabase.execute.select(
|
416
|
+
'information_schema.COLUMNS',
|
417
|
+
where=where,
|
418
|
+
order='`ORDINAL_POSITION`',
|
419
|
+
database_name=self._database_name,
|
420
|
+
table_name=self._table_name
|
421
|
+
)
|
466
422
|
|
467
423
|
# Convert.
|
468
424
|
info_table = result.to_table()
|
@@ -522,29 +478,15 @@ class DatabaseInformationColumn(DatabaseInformation):
|
|
522
478
|
"""
|
523
479
|
|
524
480
|
# Select.
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
name=self._column_name
|
535
|
-
)
|
536
|
-
|
537
|
-
## Other.
|
538
|
-
else:
|
539
|
-
where = '`TABLE_SCHEMA` = :database_name AND `TABLE_NAME` = :table_name AND `COLUMN_NAME` = :column_name'
|
540
|
-
result = self._rdatabase.execute_select(
|
541
|
-
'information_schema.COLUMNS',
|
542
|
-
where=where,
|
543
|
-
limit=1,
|
544
|
-
database_name=self._database_name,
|
545
|
-
table_name=self._table_name,
|
546
|
-
column_name=self._column_name
|
547
|
-
)
|
481
|
+
where = '`TABLE_SCHEMA` = :database_name AND `TABLE_NAME` = :table_name AND `COLUMN_NAME` = :column_name'
|
482
|
+
result = self._rdatabase.execute.select(
|
483
|
+
'information_schema.COLUMNS',
|
484
|
+
where=where,
|
485
|
+
limit=1,
|
486
|
+
database_name=self._database_name,
|
487
|
+
table_name=self._table_name,
|
488
|
+
column_name=self._column_name
|
489
|
+
)
|
548
490
|
|
549
491
|
# Convert.
|
550
492
|
info_table = result.to_table()
|
@@ -0,0 +1,16 @@
|
|
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,,
|
reydb-1.1.48.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=HYoFasGBAhXUUHNFP1doGnHBW3-xkgRc32O9KppGSak,4824
|
4
|
-
reydb/rbuild.py,sha256=iXJ76BNlUflJfMAAEbPuQLyVePyye8aDq7MaXD16Ktw,32419
|
5
|
-
reydb/rconfig.py,sha256=akY9zDQ7chmA5Hkf7Q7F_Oqqjn6gDk9B88dyLQEYMak,12886
|
6
|
-
reydb/rconn.py,sha256=UyYx-134b8KwlhBl3D3y5PdXrGceL3n9Oc7bk8xWek0,3475
|
7
|
-
reydb/rdb.py,sha256=iThWa2afN0NUkrcsp4_JXGJwPsyp6Xu-l3Qsl5xxaeY,54288
|
8
|
-
reydb/rerror.py,sha256=UFz9RnuQX83Ki-fAv9ihrRorVMKlUbawaxAwhnS-dVw,10232
|
9
|
-
reydb/rexec.py,sha256=dGdRkG1XR0Z66T0r4nPCSdQzSRWc_Q3t6TPSSrDTIxY,9042
|
10
|
-
reydb/rfile.py,sha256=CeRMdAyVEPrHEYfYb1cPubLn5EWYEHkqezyaEZ1fif8,15507
|
11
|
-
reydb/rinfo.py,sha256=KXTkcpTGAD3p9RVKKcnmc_FjJtiKRPk-K5ZepPOnphQ,15253
|
12
|
-
reydb/rparam.py,sha256=6cnSjNlX54iPS1uxMQdpazPM5XL4J87vVgfL6CIYG3U,7031
|
13
|
-
reydb-1.1.48.dist-info/METADATA,sha256=8zJUpAS0pGVWu_72FQstiWP96_dtTr3a34kb7XS-5kQ,1550
|
14
|
-
reydb-1.1.48.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
15
|
-
reydb-1.1.48.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
|
16
|
-
reydb-1.1.48.dist-info/RECORD,,
|
File without changes
|
File without changes
|