:tocdepth: 3 :py:mod:`gws.lib.sqlitex` ========================= .. py:module:: gws.lib.sqlitex .. autoapi-nested-parse:: Convenience wrapper for the SA SQLite engine. This wrapper accepts a database path and optionally an "init" DDL statement. It executes queries given in a text form. Failed queries are repeated up to 3 times to work around transient errors, like the DB being locked. If the error message is "no such table", the wrapper runs the "init" DDL before repeating. **Source code:** :source:`gws.lib.sqlitex` Package Contents ---------------- .. py:exception:: Error Bases: :py:obj:`gws.Error` Generic GWS error. .. py:class:: Object(db_path: str, init_ddl: Optional[str] = '') .. py:attribute:: dbPath .. py:attribute:: initDDL :value: '' .. py:attribute:: saEngine :type: gws.lib.sa.Engine .. py:method:: delete(table_name: str, uid) Delete a record by uid from a table. .. py:method:: execute(stmt: str, **params) Execute a text DML statement and commit. .. py:method:: insert(table_name: str, rec: dict) Insert a new record (dict) into a table. .. py:method:: select(stmt: str, **params) -> list[dict] Execute a text select statement. .. py:method:: update(table_name: str, rec: dict, uid) Update a record (dict) in a table.