anki.db#

A convenience wrapper over pysqlite.

Anki’s Collection class now uses dbproxy.py instead of this class, but this class is still used by aqt’s profile manager, and a number of add-ons rely on it.

Attributes#

Classes#

DB

Module Contents#

anki.db.DBError#
class anki.db.DB(path: str, timeout: int = 0)#

Bases: anki._legacy.DeprecatedNamesMixin

echo#
mod = False#
execute(sql: str, *a: Any, **ka: Any) sqlite3.Cursor#
executemany(sql: str, iterable: Any) None#
commit() None#
executescript(sql: str) None#
rollback() None#
scalar(*a: Any, **kw: Any) Any#
all(*a: Any, **kw: Any) list#
first(*a: Any, **kw: Any) Any#
list(*a: Any, **kw: Any) list#
close() None#
set_progress_handler(*args: Any) None#
total_changes() Any#
interrupt() None#
set_autocommit(autocommit: bool) None#
cursor(factory: type[sqlite3.Cursor] = Cursor) sqlite3.Cursor#