sqlite3.Connection.executemany()

executemany(sql[, parameters]) This is a nonstandard shortcut that creates a cursor object by calling the cursor() method, calls the cursor’s executemany() method with the parameters given, and returns the cursor.

sqlite3.Connection.execute()

execute(sql[, parameters]) This is a nonstandard shortcut that creates a cursor object by calling the cursor() method, calls the cursor’s execute() method with the parameters given, and returns the cursor.

sqlite3.Connection.enable_load_extension()

enable_load_extension(enabled) This routine allows/disallows the SQLite engine to load SQLite extensions from shared libraries. SQLite extensions can define new functions, aggregates or whole new virtual table implementations. One well-known extension is the fulltext-search extension distributed with SQLite. Loadable extensions are disabled by default. See [1]. New in version 3.2. import sqlite3 con = sqlite3.connect(":memory:") # enable extension loading con.enable_load_extension(True)

sqlite3.Connection.cursor()

cursor([cursorClass]) The cursor method accepts a single optional parameter cursorClass. If supplied, this must be a custom cursor class that extends sqlite3.Cursor.

sqlite3.Connection.create_function()

create_function(name, num_params, func) Creates a user-defined function that you can later use from within SQL statements under the function name name. num_params is the number of parameters the function accepts (if num_params is -1, the function may take any number of arguments), and func is a Python callable that is called as the SQL function. The function can return any of the types supported by SQLite: bytes, str, int, float and None. Example: import sqlite3 import hashlib def md5sum(t)

sqlite3.Connection.create_collation()

create_collation(name, callable) Creates a collation with the specified name and callable. The callable will be passed two string arguments. It should return -1 if the first is ordered lower than the second, 0 if they are ordered equal and 1 if the first is ordered higher than the second. Note that this controls sorting (ORDER BY in SQL) so your comparisons don’t affect other SQL operations. Note that the callable will get its parameters as Python bytestrings, which will normally be encoded

sqlite3.Connection.create_aggregate()

create_aggregate(name, num_params, aggregate_class) Creates a user-defined aggregate function. The aggregate class must implement a step method, which accepts the number of parameters num_params (if num_params is -1, the function may take any number of arguments), and a finalize method which will return the final result of the aggregate. The finalize method can return any of the types supported by SQLite: bytes, str, int, float and None. Example: import sqlite3 class MySum: def __init__

sqlite3.Connection.commit()

commit() This method commits the current transaction. If you don’t call this method, anything you did since the last call to commit() is not visible from other database connections. If you wonder why you don’t see the data you’ve written to the database, please check you didn’t forget to call this method.

sqlite3.Connection.close()

close() This closes the database connection. Note that this does not automatically call commit(). If you just close your database connection without calling commit() first, your changes will be lost!

sqlite3.Connection

class sqlite3.Connection A SQLite database connection has the following attributes and methods: isolation_level Get or set the current isolation level. None for autocommit mode or one of “DEFERRED”, “IMMEDIATE” or “EXCLUSIVE”. See section Controlling Transactions for a more detailed explanation. in_transaction True if a transaction is active (there are uncommitted changes), False otherwise. Read-only attribute. New in version 3.2. cursor([cursorClass]) The cursor method acce