deev.sqlite#
- class SqliteProxyConnection(provider_connection)#
Bases:
DbConnectionNormalized connection interface for sqlite3.
Ensures features are preserved wherever a connection or cursor is acquired via
deev.- commit()#
- Return type:
None
- rollback()#
- Return type:
None
- close()#
- Return type:
None
- class SqliteProxyCursor(provider_cursor)#
Bases:
DbCursorNormalized cursor interface for sqlite3.
Ensures features are preserved whenever a cursor is acquired via
deev.- property description: Sequence[tuple[Any, ...]] | None#
- property lastrowid: int | None#
- property rowcount: int#
- execute(operation, params=None)#
- Return type:
None
- executemany(operation, seq_params)#
- Return type:
None
- fetchone()#
- Return type:
tuple[Any,...] |None
- fetchmany(size=1)#
- Return type:
list[tuple[Any,...]]
- fetchall()#
- Return type:
list[tuple[Any,...]]
- close()#
- Return type:
None
- class SqliteTableAdapter(context, *, create_table=False, table_name=None)#
Bases:
Generic[TEntity]- property primary_key: tuple[str, ...]#
- create_table()#
Utility method for creating the target table.
- Return type:
None
- commit()#
- Return type:
None
- rollback()#
- Return type:
None
- create(entity=None, **kwargs)#
Creates a new record in the specified table with the provided attributes/values.
- Return type:
dict[str,Any]- Returns:
the primary key of the created entity.
- read(**kwargs)#
Reads a record from the specified table with the key represented by kwargs.
- Return type:
Optional[TypeVar(TEntity)]
- update(entity)#
- Return type:
None
- delete(**kwargs)#
- Return type:
None
- exists(**kwargs)#
- Return type:
bool
- upsert(entity)#
- Return type:
dict[str,Any]
- query(where=None, params=None, orderby=None, limit=None)#
- Return type:
Generator[TypeVar(TEntity),None,None]
- class SqliteTransactionContext(context)#
Bases:
DbTransactionContext- property connection: DbConnection#
- begin_transaction()#
- Return type:
- close()#
- Return type:
None
- commit()#
- Return type:
None
- execute(sql, params=None)#
An execute method that more closely conforms to PEP 249.
- Parameters:
sql (
str) – A string containing the SQL statement to execute.params (
Union[tuple[Any,...],list[Any],dict[str,Any],None]) – A tuple containing the params to substitute into the SQL statement.
- Return type:
- Returns:
The cursor object the caller can use to retrieve results.
- execute_nonquery(sql, params=None)#
- Return type:
None
- execute_reader(sql, params=None)#
- Return type:
Generator[Any,None,None]
- execute_scalar(sql, params=None)#
- Return type:
Any
- execute_script(sql)#
- Return type:
None
- rollback()#
- Return type:
None
- class SqliteTypeMapper(entity_spec)#
Bases:
DbTypeMapper- get_provider_type(field_name)#
Get the SQL type (string) needed to represent an entity field in the underlying table.
- Parameters:
field_spec – The “Entity Field Spec”.
- Return type:
str- Returns:
The SQL type string.