💾 Archived View for tris.fyi › pydoc › _sqlite3 captured on 2023-01-29 at 03:47:17. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-07-16)

🚧 View Differences

-=-=-=-=-=-=-

Back to module index

Go to module by name

_sqlite3

This module has no docstring.

Classes

Connection

SQLite database connection object.
backup(self, /, target, *, pages=-1, progress=None, name='main', sleep=0.25)

  Makes a backup of the database.
close(self, /)

  Close the database connection.

  Any pending transaction is not committed implicitly.
commit(self, /)

  Commit any pending transaction to the database.

  If there is no open transaction, this method is a no-op.
create_aggregate(self, /, name, n_arg, aggregate_class)

  Creates a new aggregate.
create_collation(self, name, callback, /)

  Creates a collation function.
create_function(self, /, name, narg, func, *, deterministic=False)

  Creates a new function.
cursor(...)

  Return a cursor for the connection.
enable_load_extension(self, enable, /)

  Enable dynamic loading of SQLite extension modules.
execute(...)

  Executes an SQL statement.
executemany(self, sql, parameters, /)

  Repeatedly executes an SQL statement.
executescript(self, sql_script, /)

  Executes multiple SQL statements at once.
interrupt(self, /)

  Abort any pending database operation.
iterdump(self, /)

  Returns iterator to the dump of the database in an SQL text format.
load_extension(self, name, /)

  Load SQLite extension module.
rollback(self, /)

  Roll back to the start of any pending transaction.

  If there is no open transaction, this method is a no-op.
set_authorizer(self, /, authorizer_callback)

  Sets authorizer callback.
set_progress_handler(self, /, progress_handler, n)

  Sets progress handler callback.
set_trace_callback(self, /, trace_callback)

  Sets a trace callback called for each SQL statement (passed as unicode).
DataError = <member 'DataError' of 'sqlite3.Connection' objects>
DatabaseError = <member 'DatabaseError' of 'sqlite3.Connection' objects>
Error = <member 'Error' of 'sqlite3.Connection' objects>
IntegrityError = <member 'IntegrityError' of 'sqlite3.Connection' objects>
InterfaceError = <member 'InterfaceError' of 'sqlite3.Connection' objects>
InternalError = <member 'InternalError' of 'sqlite3.Connection' objects>
NotSupportedError = <member 'NotSupportedError' of 'sqlite3.Connection' objects>
OperationalError = <member 'OperationalError' of 'sqlite3.Connection' objects>
ProgrammingError = <member 'ProgrammingError' of 'sqlite3.Connection' objects>
Warning = <member 'Warning' of 'sqlite3.Connection' objects>
in_transaction = <attribute 'in_transaction' of 'sqlite3.Connection' objects>
isolation_level = <attribute 'isolation_level' of 'sqlite3.Connection' objects>
row_factory = <member 'row_factory' of 'sqlite3.Connection' objects>
text_factory = <member 'text_factory' of 'sqlite3.Connection' objects>
total_changes = <attribute 'total_changes' of 'sqlite3.Connection' objects>

Cursor

SQLite database cursor class.
close(self, /)

  Closes the cursor.
execute(self, sql, parameters=(), /)

  Executes an SQL statement.
executemany(self, sql, seq_of_parameters, /)

  Repeatedly executes an SQL statement.
executescript(self, sql_script, /)

  Executes multiple SQL statements at once.
fetchall(self, /)

  Fetches all rows from the resultset.
fetchmany(self, /, size=1)

  Fetches several rows from the resultset.

    size
      The default value is set by the Cursor.arraysize attribute.
fetchone(self, /)

  Fetches one row from the resultset.
setinputsizes(self, sizes, /)

  Required by DB-API. Does nothing in sqlite3.
setoutputsize(self, size, column=None, /)

  Required by DB-API. Does nothing in sqlite3.
arraysize = <member 'arraysize' of 'sqlite3.Cursor' objects>
connection = <member 'connection' of 'sqlite3.Cursor' objects>
description = <member 'description' of 'sqlite3.Cursor' objects>
lastrowid = <member 'lastrowid' of 'sqlite3.Cursor' objects>
row_factory = <member 'row_factory' of 'sqlite3.Cursor' objects>
rowcount = <member 'rowcount' of 'sqlite3.Cursor' objects>

DataError

with_traceback(...)

  Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.
args = <attribute 'args' of 'BaseException' objects>

DatabaseError

with_traceback(...)

  Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.
args = <attribute 'args' of 'BaseException' objects>

Error

with_traceback(...)

  Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.
args = <attribute 'args' of 'BaseException' objects>

IntegrityError

with_traceback(...)

  Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.
args = <attribute 'args' of 'BaseException' objects>

InterfaceError

with_traceback(...)

  Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.
args = <attribute 'args' of 'BaseException' objects>

InternalError

with_traceback(...)

  Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.
args = <attribute 'args' of 'BaseException' objects>

NotSupportedError

with_traceback(...)

  Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.
args = <attribute 'args' of 'BaseException' objects>

OperationalError

with_traceback(...)

  Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.
args = <attribute 'args' of 'BaseException' objects>

PrepareProtocol

PEP 246 style object adaption protocol type.

ProgrammingError

with_traceback(...)

  Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.
args = <attribute 'args' of 'BaseException' objects>

Row

keys(self, /)

  Returns the keys of the row.

Warning

with_traceback(...)

  Exception.with_traceback(tb) --
      set self.__traceback__ to tb and return self.
args = <attribute 'args' of 'BaseException' objects>

Functions

adapt

adapt(...)

  Adapt given object to given protocol.

complete_statement

complete_statement(statement)

  Checks if a string contains a complete SQL statement.

connect

connect(...)

  connect(database[, timeout, detect_types, isolation_level,
          check_same_thread, factory, cached_statements, uri])

  Opens a connection to the SQLite database file *database*. You can use
  ":memory:" to open a database connection to a database that resides in
  RAM instead of on disk.

enable_callback_tracebacks

enable_callback_tracebacks(enable, /)

  Enable or disable callback functions throwing errors to stderr.

enable_shared_cache

enable_shared_cache(do_enable)

  Enable or disable shared cache mode for the calling thread.

  This method is deprecated and will be removed in Python 3.12.
  Shared cache is strongly discouraged by the SQLite 3 documentation.
  If shared cache must be used, open the database in URI mode using
  the cache=shared query parameter.

register_adapter

register_adapter(type, adapter, /)

  Register a function to adapt Python objects to SQLite values.

register_converter

register_converter(typename, converter, /)

  Register a function to convert SQLite values to Python objects.

Other members

PARSE_COLNAMES = 2
PARSE_DECLTYPES = 1
SQLITE_ALTER_TABLE = 26
SQLITE_ANALYZE = 28
SQLITE_ATTACH = 24
SQLITE_CREATE_INDEX = 1
SQLITE_CREATE_TABLE = 2
SQLITE_CREATE_TEMP_INDEX = 3
SQLITE_CREATE_TEMP_TABLE = 4
SQLITE_CREATE_TEMP_TRIGGER = 5
SQLITE_CREATE_TEMP_VIEW = 6
SQLITE_CREATE_TRIGGER = 7
SQLITE_CREATE_VIEW = 8
SQLITE_CREATE_VTABLE = 29
SQLITE_DELETE = 9
SQLITE_DENY = 1
SQLITE_DETACH = 25
SQLITE_DONE = 101
SQLITE_DROP_INDEX = 10
SQLITE_DROP_TABLE = 11
SQLITE_DROP_TEMP_INDEX = 12
SQLITE_DROP_TEMP_TABLE = 13
SQLITE_DROP_TEMP_TRIGGER = 14
SQLITE_DROP_TEMP_VIEW = 15
SQLITE_DROP_TRIGGER = 16
SQLITE_DROP_VIEW = 17
SQLITE_DROP_VTABLE = 30
SQLITE_FUNCTION = 31
SQLITE_IGNORE = 2
SQLITE_INSERT = 18
SQLITE_OK = 0
SQLITE_PRAGMA = 19
SQLITE_READ = 20
SQLITE_RECURSIVE = 33
SQLITE_REINDEX = 27
SQLITE_SAVEPOINT = 32
SQLITE_SELECT = 21
SQLITE_TRANSACTION = 22
SQLITE_UPDATE = 23
adapters = {(<class 'datetime.date'>, <class 'sqlite3.PrepareProtocol'>): <function register_adapters_and_converters.<locals>.adapt_date at 0x7f75e0c4beb0>, (<class 'datetime.datetime'>, <class 'sqlite3.PrepareProtocol'>): <function register_adapters_and_converters.<locals>.adapt_datetime at 0x7f75e0c4bf40>}
converters = {'DATE': <function register_adapters_and_converters.<locals>.convert_date at 0x7f75e09e0040>, 'TIMESTAMP': <function register_adapters_and_converters.<locals>.convert_timestamp at 0x7f75e09e00d0>}
sqlite_version = '3.39.4'
version = '2.6.0'