reydb 1.2.19__py3-none-any.whl → 1.2.20__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/rexec.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2025-09-22 22:12:33
5
+ @Time : 2025-09-22
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Execute methods.
@@ -87,7 +87,7 @@ class DatabaseExecuteSuper(DatabaseBase, Generic[DatabaseConnectionT]):
87
87
  """
88
88
 
89
89
  # Parameter.
90
- echo = get_first_notnone(echo, self.conn.db.echo)
90
+ echo = get_first_notnone(echo, self.conn.engine.echo)
91
91
  sql = handle_sql(sql)
92
92
  if data is None:
93
93
  if kwdata == {}:
@@ -143,7 +143,7 @@ class DatabaseExecuteSuper(DatabaseBase, Generic[DatabaseConnectionT]):
143
143
 
144
144
  # Parameter.
145
145
  if type(path) == str:
146
- database, table = self.conn.db.database, path
146
+ database, table = self.conn.engine.database, path
147
147
  else:
148
148
  database, table = path
149
149
 
@@ -241,7 +241,7 @@ class DatabaseExecuteSuper(DatabaseBase, Generic[DatabaseConnectionT]):
241
241
 
242
242
  # Parameter.
243
243
  if type(path) == str:
244
- database, table = self.conn.db.database, path
244
+ database, table = self.conn.engine.database, path
245
245
  else:
246
246
  database, table = path
247
247
 
@@ -384,7 +384,7 @@ class DatabaseExecuteSuper(DatabaseBase, Generic[DatabaseConnectionT]):
384
384
 
385
385
  # Parameter.
386
386
  if type(path) == str:
387
- database, table = self.conn.db.database, path
387
+ database, table = self.conn.engine.database, path
388
388
  else:
389
389
  database, table = path
390
390
 
@@ -518,7 +518,7 @@ class DatabaseExecuteSuper(DatabaseBase, Generic[DatabaseConnectionT]):
518
518
 
519
519
  # Parameter.
520
520
  if type(path) == str:
521
- database, table = self.conn.db.database, path
521
+ database, table = self.conn.engine.database, path
522
522
  else:
523
523
  database, table = path
524
524
 
@@ -581,7 +581,7 @@ class DatabaseExecuteSuper(DatabaseBase, Generic[DatabaseConnectionT]):
581
581
 
582
582
  # Parameter.
583
583
  if type(path) == str:
584
- database, table = self.conn.db.database, path
584
+ database, table = self.conn.engine.database, path
585
585
  else:
586
586
  database, table = path
587
587
  if fields is None:
@@ -1236,7 +1236,7 @@ class DatabaseExecuteAsync(DatabaseExecuteSuper['rconn.DatabaseConnectionAsync']
1236
1236
  if self.conn.autocommit:
1237
1237
  await self.conn.commit()
1238
1238
  await self.conn.close()
1239
- await self.conn.db.dispose()
1239
+ await self.conn.engine.dispose()
1240
1240
 
1241
1241
  return result
1242
1242
 
reydb/rinfo.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2022-12-05 14:10:02
5
+ @Time : 2022-12-05
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Database information methods.
@@ -11,7 +11,7 @@
11
11
 
12
12
  from typing import Literal, TypeVar, Generic, Final, overload
13
13
 
14
- from . import rdb
14
+ from . import rengine
15
15
  from .rbase import DatabaseBase
16
16
  from .rexec import Result
17
17
 
@@ -35,7 +35,7 @@ __all__ = (
35
35
  )
36
36
 
37
37
 
38
- DatabaseT = TypeVar('DatabaseT', 'rdb.Database', 'rdb.DatabaseAsync')
38
+ DatabaseEngineT = TypeVar('DatabaseEngineT', 'rengine.DatabaseEngine', 'rengine.DatabaseEngineAsync')
39
39
 
40
40
 
41
41
  class DatabaseInformationBase(DatabaseBase):
@@ -44,23 +44,23 @@ class DatabaseInformationBase(DatabaseBase):
44
44
  """
45
45
 
46
46
 
47
- class DatabaseInformationSchemaSuper(DatabaseInformationBase, Generic[DatabaseT]):
47
+ class DatabaseInformationSchemaSuper(DatabaseInformationBase, Generic[DatabaseEngineT]):
48
48
  """
49
49
  Database information schema super type.
50
50
  """
51
51
 
52
52
 
53
- def __init__(self, db: DatabaseT) -> None:
53
+ def __init__(self, engine: DatabaseEngineT) -> None:
54
54
  """
55
55
  Build instance attributes.
56
56
 
57
57
  Parameters
58
58
  ----------
59
- db: Database instance.
59
+ engine: Database engine.
60
60
  """
61
61
 
62
62
  # Parameter.
63
- self.db = db
63
+ self.engine = engine
64
64
 
65
65
  def handle_before__call__(self, filter_default: bool = True) -> tuple[str, tuple[str, ...]]:
66
66
  """
@@ -214,7 +214,7 @@ class DatabaseInformationSchemaSuper(DatabaseInformationBase, Generic[DatabaseT]
214
214
  return judge
215
215
 
216
216
 
217
- class DatabaseInformationSchema(DatabaseInformationSchemaSuper['rdb.Database']):
217
+ class DatabaseInformationSchema(DatabaseInformationSchemaSuper['rengine.DatabaseEngine']):
218
218
  """
219
219
  Database information schema type.
220
220
  """
@@ -235,14 +235,14 @@ class DatabaseInformationSchema(DatabaseInformationSchemaSuper['rdb.Database']):
235
235
 
236
236
  # Get.
237
237
  sql, filter_db = self.handle_before__call__(filter_default)
238
- result = self.db.execute(sql, filter_db=filter_db)
238
+ result = self.engine.execute(sql, filter_db=filter_db)
239
239
  schema = self.handle_after__call__(result)
240
240
 
241
241
  # Cache.
242
- if self.db._schema is None:
243
- self.db._schema = schema
242
+ if self.engine._schema is None:
243
+ self.engine._schema = schema
244
244
  else:
245
- self.db._schema.update(schema)
245
+ self.engine._schema.update(schema)
246
246
 
247
247
  return schema
248
248
 
@@ -301,9 +301,9 @@ class DatabaseInformationSchema(DatabaseInformationSchemaSuper['rdb.Database']):
301
301
  # Parameter.
302
302
  if (
303
303
  cache
304
- and self.db._schema is not None
304
+ and self.engine._schema is not None
305
305
  ):
306
- schema = self.db._schema
306
+ schema = self.engine._schema
307
307
  else:
308
308
  schema = self.schema()
309
309
 
@@ -313,7 +313,7 @@ class DatabaseInformationSchema(DatabaseInformationSchemaSuper['rdb.Database']):
313
313
  return result
314
314
 
315
315
 
316
- class DatabaseInformationSchemaAsync(DatabaseInformationSchemaSuper['rdb.DatabaseAsync']):
316
+ class DatabaseInformationSchemaAsync(DatabaseInformationSchemaSuper['rengine.DatabaseEngineAsync']):
317
317
  """
318
318
  Asynchronous database information schema type.
319
319
  """
@@ -334,12 +334,12 @@ class DatabaseInformationSchemaAsync(DatabaseInformationSchemaSuper['rdb.Databas
334
334
 
335
335
  # Get.
336
336
  sql, filter_db = self.handle_before__call__(filter_default)
337
- result = await self.db.execute(sql, filter_db=filter_db)
337
+ result = await self.engine.execute(sql, filter_db=filter_db)
338
338
  schema = self.handle_after__call__(result)
339
339
 
340
340
  # Cache.
341
- if self.db._schema is not None:
342
- self.db._schema.update(schema)
341
+ if self.engine._schema is not None:
342
+ self.engine._schema.update(schema)
343
343
 
344
344
  return schema
345
345
 
@@ -398,11 +398,11 @@ class DatabaseInformationSchemaAsync(DatabaseInformationSchemaSuper['rdb.Databas
398
398
  # Parameter.
399
399
  if (
400
400
  refresh
401
- or self.db._schema is None
401
+ or self.engine._schema is None
402
402
  ):
403
403
  schema = await self.schema()
404
404
  else:
405
- schema = self.db._schema
405
+ schema = self.engine._schema
406
406
 
407
407
  # Judge.
408
408
  result = self.handle_exist(schema, database, table, column)
@@ -410,7 +410,7 @@ class DatabaseInformationSchemaAsync(DatabaseInformationSchemaSuper['rdb.Databas
410
410
  return result
411
411
 
412
412
 
413
- class DatabaseInformationParameterSuper(DatabaseInformationBase, Generic[DatabaseT]):
413
+ class DatabaseInformationParameterSuper(DatabaseInformationBase, Generic[DatabaseEngineT]):
414
414
  """
415
415
  Database information parameters super type.
416
416
  """
@@ -421,21 +421,21 @@ class DatabaseInformationParameterSuper(DatabaseInformationBase, Generic[Databas
421
421
 
422
422
  def __init__(
423
423
  self,
424
- db: DatabaseT
424
+ engine: DatabaseEngineT
425
425
  ) -> None:
426
426
  """
427
427
  Build instance attributes.
428
428
 
429
429
  Parameters
430
430
  ----------
431
- db: Database instance.
431
+ engine: Database engine.
432
432
  """
433
433
 
434
434
  # Parameter.
435
- self.db = db
435
+ self.engine = engine
436
436
 
437
437
 
438
- class DatabaseInformationParameter(DatabaseInformationParameterSuper['rdb.Database']):
438
+ class DatabaseInformationParameter(DatabaseInformationParameterSuper['rengine.DatabaseEngine']):
439
439
  """
440
440
  Database information parameters type.
441
441
  """
@@ -509,13 +509,13 @@ class DatabaseInformationParameter(DatabaseInformationParameterSuper['rdb.Databa
509
509
 
510
510
  ## Dictionary.
511
511
  if key is None:
512
- result = self.db.execute(sql, key=key)
512
+ result = self.engine.execute(sql, key=key)
513
513
  status = result.to_dict(val_field=1)
514
514
 
515
515
  ## Value.
516
516
  else:
517
517
  sql += ' LIKE :key'
518
- result = self.db.execute(sql, key=key)
518
+ result = self.engine.execute(sql, key=key)
519
519
  row = result.first()
520
520
  if row is None:
521
521
  status = None
@@ -554,10 +554,10 @@ class DatabaseInformationParameter(DatabaseInformationParameterSuper['rdb.Databa
554
554
  ) + sql_set
555
555
 
556
556
  # Execute SQL.
557
- self.db.execute(sql)
557
+ self.engine.execute(sql)
558
558
 
559
559
 
560
- class DatabaseInformationParameterAsync(DatabaseInformationParameterSuper['rdb.DatabaseAsync']):
560
+ class DatabaseInformationParameterAsync(DatabaseInformationParameterSuper['rengine.DatabaseEngineAsync']):
561
561
  """
562
562
  Asynchronous database information parameters type.
563
563
  """
@@ -631,13 +631,13 @@ class DatabaseInformationParameterAsync(DatabaseInformationParameterSuper['rdb.D
631
631
 
632
632
  ## Dictionary.
633
633
  if key is None:
634
- result = await self.db.execute(sql, key=key)
634
+ result = await self.engine.execute(sql, key=key)
635
635
  status = result.to_dict(val_field=1)
636
636
 
637
637
  ## Value.
638
638
  else:
639
639
  sql += ' LIKE :key'
640
- result = await self.db.execute(sql, key=key)
640
+ result = await self.engine.execute(sql, key=key)
641
641
  row = result.first()
642
642
  if row is None:
643
643
  status = None
@@ -680,7 +680,7 @@ class DatabaseInformationParameterAsync(DatabaseInformationParameterSuper['rdb.D
680
680
  ) + sql_set
681
681
 
682
682
  # Execute SQL.
683
- await self.db.execute(sql)
683
+ await self.engine.execute(sql)
684
684
 
685
685
 
686
686
  class DatabaseInformationParameterVariables(DatabaseInformationParameter):
reydb/rorm.py CHANGED
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  """
5
- @Time : 2025-09-23 00:50:32
5
+ @Time : 2025-09-23
6
6
  @Author : Rey
7
7
  @Contact : reyxbo@163.com
8
8
  @Explain : Database ORM methods.
@@ -32,7 +32,7 @@ from datetime import datetime, date, time, timedelta
32
32
  from warnings import filterwarnings
33
33
  from reykit.rbase import CallableT, Null, throw, is_instance
34
34
 
35
- from . import rdb
35
+ from . import rengine
36
36
  from .rbase import (
37
37
  SessionT,
38
38
  SessionTransactionT,
@@ -69,7 +69,7 @@ __all__ = (
69
69
  )
70
70
 
71
71
 
72
- DatabaseT = TypeVar('DatabaseT', 'rdb.Database', 'rdb.DatabaseAsync')
72
+ DatabaseEngineT = TypeVar('DatabaseEngineT', 'rengine.DatabaseEngine', 'rengine.DatabaseEngineAsync')
73
73
  DatabaseORMModelT = TypeVar('DatabaseORMModelT', bound='DatabaseORMModel')
74
74
  DatabaseORMT = TypeVar('DatabaseORMT', 'DatabaseORM', 'DatabaseORMAsync')
75
75
  DatabaseORMSessionT = TypeVar('DatabaseORMSessionT', 'DatabaseORMSession', 'DatabaseORMSessionAsync')
@@ -504,23 +504,23 @@ class DatabaseORMModelMethod(DatabaseORMBase):
504
504
  return instance
505
505
 
506
506
 
507
- class DatabaseORMSuper(DatabaseORMBase, Generic[DatabaseT, DatabaseORMSessionT]):
507
+ class DatabaseORMSuper(DatabaseORMBase, Generic[DatabaseEngineT, DatabaseORMSessionT]):
508
508
  """
509
509
  Database ORM super type.
510
510
  """
511
511
 
512
512
 
513
- def __init__(self, db: DatabaseT) -> None:
513
+ def __init__(self, engine: DatabaseEngineT) -> None:
514
514
  """
515
515
  Build instance attributes.
516
516
 
517
517
  Parameters
518
518
  ----------
519
- db: Database instance.
519
+ engine: Database engine.
520
520
  """
521
521
 
522
522
  # Build.
523
- self.db = db
523
+ self.engine = engine
524
524
  self.__sess = self.session(True)
525
525
 
526
526
  ## Method.
@@ -559,13 +559,13 @@ class DatabaseORMSuper(DatabaseORMBase, Generic[DatabaseT, DatabaseORMSessionT])
559
559
  return sess
560
560
 
561
561
 
562
- class DatabaseORM(DatabaseORMSuper['rdb.Database', 'DatabaseORMSession']):
562
+ class DatabaseORM(DatabaseORMSuper['rengine.DatabaseEngine', 'DatabaseORMSession']):
563
563
  """
564
564
  Database ORM type.
565
565
  """
566
566
 
567
567
 
568
- class DatabaseORMAsync(DatabaseORMSuper['rdb.DatabaseAsync', 'DatabaseORMSessionAsync']):
568
+ class DatabaseORMAsync(DatabaseORMSuper['rengine.DatabaseEngineAsync', 'DatabaseORMSessionAsync']):
569
569
  """
570
570
  Asynchronous database ORM type.
571
571
  """
@@ -777,7 +777,7 @@ class DatabaseORMSession(
777
777
 
778
778
  # Create.
779
779
  if self.session is None:
780
- self.session = Session(self.orm.db.engine)
780
+ self.session = Session(self.orm.engine.engine)
781
781
 
782
782
  return self.session
783
783
 
@@ -863,7 +863,7 @@ class DatabaseORMSession(
863
863
 
864
864
  # Session.
865
865
  if self.session is None:
866
- self.session = Session(self.orm.db.engine)
866
+ self.session = Session(self.orm.engine.engine)
867
867
 
868
868
  # Begin.
869
869
  if self.begin is None:
@@ -909,7 +909,7 @@ class DatabaseORMSession(
909
909
  throw(ValueError, tables)
910
910
 
911
911
  # Create.
912
- metadata.create_all(self.orm.db.engine, tables, skip)
912
+ metadata.create_all(self.orm.engine.engine, tables, skip)
913
913
 
914
914
 
915
915
  @wrap_transact
@@ -938,7 +938,7 @@ class DatabaseORMSession(
938
938
  throw(ValueError, tables)
939
939
 
940
940
  # Drop.
941
- metadata.drop_all(self.orm.db.engine, tables, skip)
941
+ metadata.drop_all(self.orm.engine.engine, tables, skip)
942
942
 
943
943
 
944
944
  @wrap_transact
@@ -1144,7 +1144,7 @@ class DatabaseORMSessionAsync(
1144
1144
 
1145
1145
  # Close.
1146
1146
  await self.close()
1147
- await self.orm.db.dispose()
1147
+ await self.orm.engine.dispose()
1148
1148
 
1149
1149
 
1150
1150
  def get_sess(self) -> AsyncSession:
@@ -1158,7 +1158,7 @@ class DatabaseORMSessionAsync(
1158
1158
 
1159
1159
  # Create.
1160
1160
  if self.session is None:
1161
- self.session = AsyncSession(self.orm.db.engine)
1161
+ self.session = AsyncSession(self.orm.engine.engine)
1162
1162
 
1163
1163
  return self.session
1164
1164
 
@@ -1255,7 +1255,7 @@ class DatabaseORMSessionAsync(
1255
1255
  if self.autocommit:
1256
1256
  await self.commit()
1257
1257
  await self.close()
1258
- await self.orm.db.dispose()
1258
+ await self.orm.engine.dispose()
1259
1259
 
1260
1260
  return result
1261
1261
 
@@ -1597,7 +1597,7 @@ class DatabaseORMStatementAsync(DatabaseORMStatementSuper[DatabaseORMSessionAsyn
1597
1597
 
1598
1598
  await self.sess.commit()
1599
1599
  await self.sess.close()
1600
- await self.sess.orm.db.dispose()
1600
+ await self.sess.orm.engine.dispose()
1601
1601
 
1602
1602
  return result
1603
1603
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reydb
3
- Version: 1.2.19
3
+ Version: 1.2.20
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=BnJsTzcwqeQ8-5Boqsehgcpc1eSDkv41v0kdb10gAgM,643
2
+ reydb/rall.py,sha256=5GI0yuwF72XypNZ1DYIxKizo2Z5pR88Uv0nUpHKYhCk,379
3
+ reydb/rbase.py,sha256=S3ip2PxvLn2Spgv5G_xd7xgC-U4wjEoAZ7Up25ZQvLk,8223
4
+ reydb/rbuild.py,sha256=6ZkU3LGkIk04KTPtd8fgTC4pX93p1tvbOhZWWEi-v5A,40846
5
+ reydb/rconfig.py,sha256=oOYGqhFzWVPx57D-Bbw6B2F9VmqGc_Y-aTy-mJd0Cgk,18163
6
+ reydb/rconn.py,sha256=K_k6cJ94yrPIFaSZ06enpguTWVPhDu67LHan41C1bRA,7023
7
+ reydb/rdb.py,sha256=X3ZScVFnPAm6Cqmsx13CCumQH3ZwEQcL4UqpoY42APg,2708
8
+ reydb/rengine.py,sha256=CoUh0n5ZG1oRdbcTqCl-s8R8ePXJtIxDg79E6dGx2dU,15644
9
+ reydb/rerror.py,sha256=M7RPXwywLYl5Vew7jfXxUxVnBrM1b_T6V9Izt4B8zI0,14791
10
+ reydb/rexec.py,sha256=hZe5SRbqo_aTpuB1vI2HXVx1FjtwvKGLRom3uzjTuqI,52949
11
+ reydb/rinfo.py,sha256=c5otyOikGMVnLFhPbtlgmnFBRR3NMP7xcmMW-LQdaQk,18314
12
+ reydb/rorm.py,sha256=mnfVf6fulTJ84EyjFqYijdAwdwaybBVvyZKNG4EhbwU,50065
13
+ reydb-1.2.20.dist-info/METADATA,sha256=3WSGgIL7ScE69ImeI9ma3zezy-rgNmZ0dxe1a1WPr1k,1647
14
+ reydb-1.2.20.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
+ reydb-1.2.20.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
16
+ reydb-1.2.20.dist-info/RECORD,,
@@ -1,15 +0,0 @@
1
- reydb/__init__.py,sha256=MJkZy2rOM2VSj_L2kaKe6CJfsg334vb3OLVUqavWKfM,558
2
- reydb/rall.py,sha256=IxSPGh77xz7ndDC7J8kZ_66Gq_xTAztGtnELUku1Ouw,364
3
- reydb/rbase.py,sha256=sl2lZWQVC5kXTJid2v5zmy1lMshYLm2NhEQi_dnY_Bw,8232
4
- reydb/rbuild.py,sha256=0cpV7nZM21KtcG90U9Q8gjNBOKhc-ShwSH5wh99l94o,40597
5
- reydb/rconfig.py,sha256=cPFt9QI_lj0u4tChBJ0kHYf2G788epbT2oSYk2r24yo,18010
6
- reydb/rconn.py,sha256=guRaR8N6RuzZzujwaeq7HhKWTizF9SrUBqEAFjfjpoo,6909
7
- reydb/rdb.py,sha256=nieXxFqf07Dljl-12Ub8R8s-uNZjai7PN2rqlvOxyqw,15408
8
- reydb/rerror.py,sha256=O7lbnkAamQa1OKz6WJPeBUkzDTP6LNGqBqCfrI02DO4,14722
9
- reydb/rexec.py,sha256=uj87vAeKnqNg9tWCy0ycjI9uMj0IgZCS4waL9cC_mTY,52930
10
- reydb/rinfo.py,sha256=1lMnD-eN97vHrQ1DM8X7mQIhyLmCg6V0P2QwSeF07_c,18127
11
- reydb/rorm.py,sha256=vCNTH6bAg_3Hg8E6nOGDSZ82sZq6gkiQI5rds_hJbV4,49960
12
- reydb-1.2.19.dist-info/METADATA,sha256=VCP-3YkgjexOuDjSYs7IGMhe85qzX_3pbLiQRCUjayA,1647
13
- reydb-1.2.19.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
- reydb-1.2.19.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
15
- reydb-1.2.19.dist-info/RECORD,,
File without changes