Transaction#
- class beets.dbcore.db.Transaction(db: Database)[source]#
Bases:
objectA context manager for safe, concurrent access to the database. All SQL commands should be executed through a transaction.
Public methods summary
mutate(statement[, subvals])Run one write statement with shared mutation/error handling.
mutate_many(statement[, subvals])Run batched writes with shared mutation/error handling.
query(statement[, subvals])Execute an SQL statement with substitution values and return a list of rows from the database.
script(statements)Execute a string containing multiple SQL statements.
Methods definition
- query(statement: str, subvals: Sequence[SQLiteType] = ()) list[sqlite3.Row][source]#
Execute an SQL statement with substitution values and return a list of rows from the database.
- mutate(statement: str, subvals: Sequence[SQLiteType] = ()) Any[source]#
Run one write statement with shared mutation/error handling.