reydb 1.1.48__py3-none-any.whl → 1.1.50__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/rerror.py CHANGED
@@ -13,10 +13,9 @@ from typing import Any
13
13
  from collections.abc import Callable
14
14
  from traceback import StackSummary
15
15
  from functools import wraps as functools_wraps
16
- from reykit.rbase import T, Exit, throw, catch_exc
16
+ from reykit.rbase import T, Exit, catch_exc
17
17
 
18
18
  from .rbase import DatabaseBase
19
- from .rconn import DatabaseConnection
20
19
  from .rdb import Database
21
20
 
22
21
 
@@ -32,22 +31,17 @@ class DatabaseError(DatabaseBase):
32
31
  """
33
32
 
34
33
 
35
- def __init__(self, database: Database | DatabaseConnection) -> None:
34
+ def __init__(self, db: Database) -> None:
36
35
  """
37
36
  Build instance attributes.
38
37
 
39
38
  Parameters
40
39
  ----------
41
- database : Database or DatabaseConnection instance.
40
+ db: Database instance.
42
41
  """
43
42
 
44
- # SQLite.
45
- if database.backend == 'sqlite':
46
- text = 'not suitable for SQLite databases'
47
- throw(AssertionError, text=text)
48
-
49
43
  # Build.
50
- self.database = database
44
+ self.db = db
51
45
 
52
46
  ## Database path name.
53
47
  self.db_names = {
@@ -189,7 +183,7 @@ class DatabaseError(DatabaseBase):
189
183
  ]
190
184
 
191
185
  # Build.
192
- self.database.build.build(databases, tables, views_stats=views_stats)
186
+ self.db.build.build(databases, tables, views_stats=views_stats)
193
187
 
194
188
 
195
189
  def record(
@@ -228,7 +222,7 @@ class DatabaseError(DatabaseBase):
228
222
  }
229
223
 
230
224
  # Insert.
231
- self.database.execute_insert(
225
+ self.db.execute.insert(
232
226
  (self.db_names['base'], self.db_names['base.error']),
233
227
  data=data
234
228
  )