reydb 1.1.47__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/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.execute_exist(
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.execute_insert(
346
+ conn.execute.insert(
352
347
  (self.db_names['file'], self.db_names['file.data']),
353
348
  data,
354
349
  'ignore'
@@ -360,13 +355,13 @@ class DatabaseFile(DatabaseBase):
360
355
  'name': file_name,
361
356
  'note': note
362
357
  }
363
- conn.execute_insert(
358
+ conn.execute.insert(
364
359
  (self.db_names['file'], self.db_names['file.information']),
365
360
  data
366
361
  )
367
362
 
368
363
  # Get ID.
369
- file_id = conn.variables['identity']
364
+ file_id = conn.insert_id
370
365
 
371
366
  # Commit.
372
367
  conn.commit()
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
- else:
225
- result = self._rdatabase.execute_select(
226
- 'information_schema.SCHEMATA',
227
- order='`schema_name`'
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.execute_select(
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
- ## SQLite.
333
- if self._rdatabase.backend == 'sqlite':
334
- result = self._rdatabase.execute_select('main.sqlite_master')
335
-
336
- ## Other.
337
- else:
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
- ## SQLite.
409
- if self._rdatabase.backend == 'sqlite':
410
- where = '`name` = :name'
411
- result = self._rdatabase.execute_select(
412
- 'main.sqlite_master',
413
- where=where,
414
- limit=1,
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
- ## SQLite.
452
- if self._rdatabase.backend == 'sqlite':
453
- sql = f'PRAGMA table_info("%s")' % self._table_name
454
- result = self._rdatabase.execute(sql)
455
-
456
- ## Other.
457
- else:
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
- ## SQLite.
527
- if self._rdatabase.backend == 'sqlite':
528
- sql = f'PRAGMA table_info("%s")' % self._table_name
529
- where = '`name` = :name'
530
- result = self._rdatabase.execute(
531
- sql,
532
- where=where,
533
- limit=1,
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()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reydb
3
- Version: 1.1.47
3
+ Version: 1.1.49
4
4
  Summary: Database method set.
5
5
  Project-URL: homepage, https://github.com/reyxbo/reydb/
6
6
  Author-email: Rey <reyxbo@163.com>
@@ -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,,
@@ -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=kFKcExyU8PjWRTr6j7ZPB4qJqFMdYNDB77Nkpw4vHcE,15519
11
- reydb/rinfo.py,sha256=KXTkcpTGAD3p9RVKKcnmc_FjJtiKRPk-K5ZepPOnphQ,15253
12
- reydb/rparam.py,sha256=6cnSjNlX54iPS1uxMQdpazPM5XL4J87vVgfL6CIYG3U,7031
13
- reydb-1.1.47.dist-info/METADATA,sha256=5jXtKibf68M6FUjL8NKHnQXLWpW5AkWIeLUbkAWcNeY,1550
14
- reydb-1.1.47.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
- reydb-1.1.47.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
16
- reydb-1.1.47.dist-info/RECORD,,
File without changes