anki.dbproxy#

Attributes#

Classes#

Functions#

emulate_named_args(→ tuple[str, ...)

Module Contents#

anki.dbproxy.ValueFromDB#
anki.dbproxy.Row#
anki.dbproxy.ValueForDB#
class anki.dbproxy.DBProxy(backend: anki._backend.RustBackend)#
transact(op: collections.abc.Callable[[], None]) None#

Run the provided operation inside a transaction.

Please note that all backend methods automatically wrap changes in a transaction, so there is no need to use this when calling methods like update_cards(), unless you are making other changes at the same time and want to ensure they are applied completely or not at all.

If the operation throws an exception, the changes will be automatically rolled back.

all(sql: str, *args: ValueForDB, **kwargs: ValueForDB) list[Row]#
list(sql: str, *args: ValueForDB, **kwargs: ValueForDB) list[ValueFromDB]#
first(sql: str, *args: ValueForDB, **kwargs: ValueForDB) Row | None#
scalar(sql: str, *args: ValueForDB, **kwargs: ValueForDB) ValueFromDB#
execute#
executemany(sql: str, args: collections.abc.Iterable[collections.abc.Sequence[ValueForDB]]) None#
anki.dbproxy.emulate_named_args(sql: str, args: tuple, kwargs: dict[str, Any]) tuple[str, collections.abc.Sequence[ValueForDB]]#