Database

class esbonio.sphinx_agent.database.Database(dbpath)[source]
class Column(name: 'str', dtype: 'str', notnull: 'bool' = False, default: 'Any | None' = None, pk: 'int' = 0)[source]
class Table(name: 'str', columns: 'list[Database.Column]')[source]
property create_statement

Return the SQL statement required to create this table.

clear_table(table, **kwargs)[source]

Clear the given table

Parameters:

kwargs – Constraints to limit the rows that get cleared

ensure_table(table)[source]

Ensure that the given table exists in the database.

If the table does exist, but has the wrong shape, it will be dropped and recreated.

insert_values(table, values)[source]

Insert the given values into the given table.