.. Automatically generated by code2rst.py
   code2rst.py src/apsw.c doc/apsw.rst
   Edit src/apsw.c not this file!

.. module:: apsw
   :synopsis: Python access to SQLite database library

APSW Module
***********

The module is the main interface to SQLite.  Methods and data on the
module have process wide effects.  You can instantiate the
:class:`Connection` and :class:`zeroblob` objects using
:meth:`Connection` and :meth:`zeroblob` respectively.

API Reference
=============

.. data:: SQLITE_VERSION_NUMBER

    The integer version number of SQLite that APSW was compiled
    against.  For example SQLite 3.6.4 will have the value *3006004*.
    This number may be different than the actual library in use if the
    library is shared and has been updated.  Call
    :meth:`sqlitelibversion` to get the actual library version.

.. method:: apswversion() -> string

  Returns the APSW version.

.. index:: sqlite3_compileoption_get

.. attribute:: compile_options

    A tuple of the options used to compile SQLite.  For example it
    will be something like this::

        ('ENABLE_LOCKING_STYLE=0', 'TEMP_STORE=1', 'THREADSAFE=1')

    Calls: `sqlite3_compileoption_get <https://sqlite.org/c3ref/compileoption_get.html>`__

.. index:: sqlite3_complete

.. method:: complete(statement) -> bool

  Returns True if the input string comprises one or more complete SQL
  statements by looking for an unquoted trailing semi-colon.

  An example use would be if you were prompting the user for SQL
  statements and needed to know if you had a whole statement, or
  needed to ask for another line::

    statement=raw_input("SQL> ")
    while not apsw.complete(statement):
       more=raw_input("  .. ")
       statement=statement+"\n"+more

  Calls: `sqlite3_complete <https://sqlite.org/c3ref/complete.html>`__

.. index:: sqlite3_config

.. method:: config(op[, *args])

  :param op: A `configuration operation <https://sqlite.org/c3ref/c_config_chunkalloc.html>`_
  :param args: Zero or more arguments as appropriate for *op*

  Many operations don't make sense from a Python program.  The
  following configuration operations are supported: SQLITE_CONFIG_LOG,
  SQLITE_CONFIG_SINGLETHREAD, SQLITE_CONFIG_MULTITHREAD,
  SQLITE_CONFIG_SERIALIZED, SQLITE_CONFIG_URI, SQLITE_CONFIG_MEMSTATUS,
  SQLITE_CONFIG_COVERING_INDEX_SCAN, SQLITE_CONFIG_PCACHE_HDRSZ, and
  SQLITE_CONFIG_PMASZ.

  See :ref:`tips <diagnostics_tips>` for an example of how to receive
  log messages (SQLITE_CONFIG_LOG)

  Calls: `sqlite3_config <https://sqlite.org/c3ref/config.html>`__

.. attribute:: connection_hooks

       The purpose of the hooks is to allow the easy registration of
       :meth:`functions <Connection.createscalarfunction>`,
       :ref:`virtual tables <virtualtables>` or similar items with
       each :class:`Connection` as it is created. The default value is an empty
       list. Whenever a Connection is created, each item in
       apsw.connection_hooks is invoked with a single parameter being
       the new Connection object. If the hook raises an exception then
       the creation of the Connection fails.

       If you wanted to store your own defined functions in the
       database then you could define a hook that looked in the
       relevant tables, got the Python text and turned it into the
       functions.

.. index:: sqlite3_enable_shared_cache

.. method:: enablesharedcache(bool)

  If you use the same :class:`Connection` across threads or use
  multiple :class:`connections <Connection>` accessing the same file,
  then SQLite can `share the cache between them
  <https://sqlite.org/sharedcache.html>`_.  It is :ref:`not
  recommended <sharedcache>` that you use this.

  Calls: `sqlite3_enable_shared_cache <https://sqlite.org/c3ref/enable_shared_cache.html>`__

.. method:: exceptionfor(int) -> Exception

  If you would like to raise an exception that corresponds to a
  particular SQLite `error code
  <https://sqlite.org/c3ref/c_abort.html>`_ then call this function.
  It also understands `extended error codes
  <https://sqlite.org/c3ref/c_ioerr_access.html>`_.

  For example to raise `SQLITE_IOERR_ACCESS <https://sqlite.org/c3ref/c_ioerr_access.html>`_::

    raise apsw.exceptionfor(apsw.SQLITE_IOERR_ACCESS)

.. method:: fork_checker()

  **Note** This method is not available on Windows as it does not
  support the fork system call.

  SQLite does not allow the use of database connections across `forked
  <http://en.wikipedia.org/wiki/Fork_(operating_system)>`__ processes
  (see the `SQLite FAQ Q6 <https://sqlite.org/faq.html#q6>`__).
  (Forking creates a child process that is a duplicate of the parent
  including the state of all data structures in the program.  If you
  do this to SQLite then parent and child would both consider
  themselves owners of open databases and silently corrupt each
  other's work and interfere with each other's locks.)

  One example of how you may end up using fork is if you use the
  `multiprocessing module
  <http://docs.python.org/library/multiprocessing.html>`__ which uses
  fork to make child processes.

  If you do use fork or multiprocessing on a platform that supports
  fork then you **must** ensure database connections and their objects
  (cursors, backup, blobs etc) are not used in the parent process, or
  are all closed before calling fork or starting a `Process
  <http://docs.python.org/library/multiprocessing.html#process-and-exceptions>`__.
  (Note you must call close to ensure the underlying SQLite objects
  are closed.  It is also a good idea to call `gc.collect(2)
  <http://docs.python.org/library/gc.html#gc.collect>`__ to ensure
  anything you may have missed is also deallocated.)

  Once you run this method, extra checking code is inserted into
  SQLite's mutex operations (at a very small performance penalty) that
  verifies objects are not used across processes.  You will get a
  :exc:`ForkingViolationError` if you do so.  Note that due to the way
  Python's internals work, the exception will be delivered to
  `sys.excepthook` in addition to the normal exception mechanisms and
  may be reported by Python after the line where the issue actually
  arose.  (Destructors of objects you didn't close also run between
  lines.)

  You should only call this method as the first line after importing
  APSW, as it has to shutdown and re-initialize SQLite.  If you have
  any SQLite objects already allocated when calling the method then
  the program will later crash.  The recommended use is to use the fork
  checking as part of your test suite.

.. method:: format_sql_value(value) -> string

  Returns a Python string (unicode) representing the supplied value in
  SQL syntax.  Python 2 note: You must supply unicode strings not
  plain strings.

.. index:: sqlite3_initialize

.. method:: initialize()

  It is unlikely you will want to call this method as SQLite automatically initializes.

  Calls: `sqlite3_initialize <https://sqlite.org/c3ref/initialize.html>`__

.. index:: sqlite3_log

.. method:: log(level, message)

    Calls the SQLite logging interface.  Note that you must format the
    message before passing it to this method::

        apsw.log(apsw.SQLITE_NOMEM, "Need %d bytes of memory" % (1234,))

    See :ref:`tips <diagnostics_tips>` for an example of how to
    receive log messages.

    Calls: `sqlite3_log <https://sqlite.org/c3ref/log.html>`__

.. method:: main()

    Call this to run the interactive shell.  It automatically passes
    in sys.argv[1:] and exits Python when done.

.. index:: sqlite3_memory_highwater

.. method:: memoryhighwater(reset=False) -> int

  Returns the maximum amount of memory SQLite has used.  If *reset* is
  True then the high water mark is reset to the current value.

  .. seealso::

    :meth:`status`

  Calls: `sqlite3_memory_highwater <https://sqlite.org/c3ref/memory_highwater.html>`__

.. index:: sqlite3_memory_used

.. method:: memoryused() -> int

  Returns the amount of memory SQLite is currently using.

  .. seealso::
    :meth:`status`

  Calls: `sqlite3_memory_used <https://sqlite.org/c3ref/memory_highwater.html>`__

.. index:: sqlite3_randomness

.. method:: randomness(bytes)  -> data

  Gets random data from SQLite's random number generator.

  :param bytes: How many bytes to return
  :rtype: (Python 2) string, (Python 3) bytes

  Calls: `sqlite3_randomness <https://sqlite.org/c3ref/randomness.html>`__

.. index:: sqlite3_release_memory

.. method:: releasememory(bytes) -> int

  Requests SQLite try to free *bytes* bytes of memory.  Returns how
  many bytes were freed.

  Calls: `sqlite3_release_memory <https://sqlite.org/c3ref/release_memory.html>`__

.. index:: sqlite3_shutdown

.. method:: shutdown()

  It is unlikely you will want to call this method and there is no
  need to do so.  It is a **really** bad idea to call it unless you
  are absolutely sure all :class:`connections <Connection>`,
  :class:`blobs <blob>`, :class:`cursors <Cursor>`, :class:`vfs <VFS>`
  etc have been closed, deleted and garbage collected.

  Calls: `sqlite3_shutdown <https://sqlite.org/c3ref/initialize.html>`__

.. index:: sqlite3_soft_heap_limit64

.. method:: softheaplimit(bytes) -> oldlimit

  Requests SQLite try to keep memory usage below *bytes* bytes and
  returns the previous setting.

  Calls: `sqlite3_soft_heap_limit64 <https://sqlite.org/c3ref/soft_heap_limit64.html>`__

.. index:: sqlite3_sourceid

.. method:: sqlite3_sourceid() -> string

    Returns the exact checkin information for the SQLite 3 source
    being used.

    Calls: `sqlite3_sourceid <https://sqlite.org/c3ref/libversion.html>`__

.. index:: sqlite3_libversion

.. method:: sqlitelibversion() -> string

  Returns the version of the SQLite library.  This value is queried at
  run time from the library so if you use shared libraries it will be
  the version in the shared library.

  Calls: `sqlite3_libversion <https://sqlite.org/c3ref/libversion.html>`__

.. index:: sqlite3_status64

.. method:: status(op, reset=False) -> (int, int)

  Returns current and highwater measurements.

  :param op: A `status parameter <https://sqlite.org/c3ref/c_status_malloc_size.html>`_
  :param reset: If *True* then the highwater is set to the current value
  :returns: A tuple of current value and highwater value

  .. seealso::

    * :ref:`Status example <example-status>`

  Calls: `sqlite3_status64 <https://sqlite.org/c3ref/status.html>`__

.. attribute:: using_amalgamation

    If True then `SQLite amalgamation
    <https://sqlite.org/cvstrac/wiki?p=TheAmalgamation>`__ is in
    use (statically compiled into APSW).  Using the amalgamation means
    that SQLite shared libraries are not used and will not affect your
    code.

.. method:: vfsnames() -> list(string)

  Returns a list of the currently installed :ref:`vfs <vfs>`.  The first
  item in the list is the default vfs.

.. _sqliteconstants:

SQLite constants
================

SQLite has `many constants
<https://sqlite.org/c3ref/constlist.html>`_ used in various
interfaces.  To use a constant such as :const:`SQLITE_OK`, just
use ``apsw.SQLITE_OK``.

The same values can be used in different contexts. For example
:const:`SQLITE_OK` and :const:`SQLITE_CREATE_INDEX` both have a value
of zero. For each group of constants there is also a mapping (dict)
available that you can supply a string to and get the corresponding
numeric value, or supply a numeric value and get the corresponding
string. These can help improve diagnostics/logging, calling other
modules etc. For example::

      apsw.mapping_authorizer_function["SQLITE_READ"] == 20
      apsw.mapping_authorizer_function[20] == "SQLITE_READ"

mapping_access `Flags for the xAccess VFS method <https://sqlite.org/c3ref/c_access_exists.html>`__

    `SQLITE_ACCESS_EXISTS <https://sqlite.org/c3ref/c_access_exists.html>`__, `SQLITE_ACCESS_READ <https://sqlite.org/c3ref/c_access_exists.html>`__, `SQLITE_ACCESS_READWRITE <https://sqlite.org/c3ref/c_access_exists.html>`__

mapping_authorizer_function `Authorizer Action Codes <https://sqlite.org/c3ref/c_alter_table.html>`__

    `SQLITE_ALTER_TABLE <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_ANALYZE <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_ATTACH <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_COPY <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_CREATE_INDEX <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_CREATE_TABLE <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_CREATE_TEMP_INDEX <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_CREATE_TEMP_TABLE <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_CREATE_TEMP_TRIGGER <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_CREATE_TEMP_VIEW <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_CREATE_TRIGGER <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_CREATE_VIEW <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_CREATE_VTABLE <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_DELETE <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_DETACH <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_DROP_INDEX <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_DROP_TABLE <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_DROP_TEMP_INDEX <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_DROP_TEMP_TABLE <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_DROP_TEMP_TRIGGER <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_DROP_TEMP_VIEW <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_DROP_TRIGGER <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_DROP_VIEW <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_DROP_VTABLE <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_FUNCTION <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_INSERT <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_PRAGMA <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_READ <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_RECURSIVE <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_REINDEX <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_SAVEPOINT <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_SELECT <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_TRANSACTION <https://sqlite.org/c3ref/c_alter_table.html>`__, `SQLITE_UPDATE <https://sqlite.org/c3ref/c_alter_table.html>`__

mapping_authorizer_return `Authorizer Return Codes <https://sqlite.org/c3ref/c_deny.html>`__

    `SQLITE_DENY <https://sqlite.org/c3ref/c_deny.html>`__, `SQLITE_IGNORE <https://sqlite.org/c3ref/c_deny.html>`__, `SQLITE_OK <https://sqlite.org/rescode.html#ok>`__

mapping_bestindex_constraints `Virtual Table Constraint Operator Codes <https://sqlite.org/c3ref/c_index_constraint_eq.html>`__

    `SQLITE_INDEX_CONSTRAINT_EQ <https://sqlite.org/c3ref/c_index_constraint_eq.html>`__, `SQLITE_INDEX_CONSTRAINT_GE <https://sqlite.org/c3ref/c_index_constraint_eq.html>`__, `SQLITE_INDEX_CONSTRAINT_GT <https://sqlite.org/c3ref/c_index_constraint_eq.html>`__, `SQLITE_INDEX_CONSTRAINT_LE <https://sqlite.org/c3ref/c_index_constraint_eq.html>`__, `SQLITE_INDEX_CONSTRAINT_LT <https://sqlite.org/c3ref/c_index_constraint_eq.html>`__, `SQLITE_INDEX_CONSTRAINT_MATCH <https://sqlite.org/c3ref/c_index_constraint_eq.html>`__

mapping_config `Configuration Options <https://sqlite.org/c3ref/c_config_covering_index_scan.html>`__

    `SQLITE_CONFIG_COVERING_INDEX_SCAN <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigcoveringindexscan>`__, `SQLITE_CONFIG_GETMALLOC <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfiggetmalloc>`__, `SQLITE_CONFIG_GETMUTEX <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfiggetmutex>`__, `SQLITE_CONFIG_GETPCACHE <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfiggetpcache>`__, `SQLITE_CONFIG_GETPCACHE2 <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfiggetpcache2>`__, `SQLITE_CONFIG_HEAP <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigheap>`__, `SQLITE_CONFIG_LOG <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfiglog>`__, `SQLITE_CONFIG_LOOKASIDE <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfiglookaside>`__, `SQLITE_CONFIG_MALLOC <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigmalloc>`__, `SQLITE_CONFIG_MEMSTATUS <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigmemstatus>`__, `SQLITE_CONFIG_MMAP_SIZE <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigmmapsize>`__, `SQLITE_CONFIG_MULTITHREAD <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigmultithread>`__, `SQLITE_CONFIG_MUTEX <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigmutex>`__, `SQLITE_CONFIG_PAGECACHE <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigpagecache>`__, `SQLITE_CONFIG_PCACHE <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigpcache>`__, `SQLITE_CONFIG_PCACHE2 <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigpcache2>`__, `SQLITE_CONFIG_PCACHE_HDRSZ <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigpcachehdrsz>`__, `SQLITE_CONFIG_PMASZ <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigpmasz>`__, `SQLITE_CONFIG_SCRATCH <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigscratch>`__, `SQLITE_CONFIG_SERIALIZED <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigserialized>`__, `SQLITE_CONFIG_SINGLETHREAD <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigsinglethread>`__, `SQLITE_CONFIG_SQLLOG <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigsqllog>`__, `SQLITE_CONFIG_URI <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfiguri>`__, `SQLITE_CONFIG_WIN32_HEAPSIZE <https://sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigwin32heapsize>`__

mapping_conflict_resolution_modes `Conflict resolution modes <https://sqlite.org/c3ref/c_fail.html>`__

    `SQLITE_ABORT <https://sqlite.org/rescode.html#abort>`__, `SQLITE_FAIL <https://sqlite.org/c3ref/c_fail.html>`__, `SQLITE_IGNORE <https://sqlite.org/c3ref/c_deny.html>`__, `SQLITE_REPLACE <https://sqlite.org/c3ref/c_fail.html>`__, `SQLITE_ROLLBACK <https://sqlite.org/c3ref/c_fail.html>`__

mapping_db_config `Database Connection Configuration Options <https://sqlite.org/c3ref/c_dbconfig_enable_fkey.html>`__

    `SQLITE_DBCONFIG_ENABLE_FKEY <https://sqlite.org/c3ref/c_dbconfig_enable_fkey.html>`__, `SQLITE_DBCONFIG_ENABLE_TRIGGER <https://sqlite.org/c3ref/c_dbconfig_enable_fkey.html>`__, `SQLITE_DBCONFIG_LOOKASIDE <https://sqlite.org/c3ref/c_dbconfig_enable_fkey.html>`__

mapping_db_status `Status Parameters for database connections <https://sqlite.org/c3ref/c_dbstatus_options.html>`__

    `SQLITE_DBSTATUS_CACHE_HIT <https://sqlite.org/c3ref/c_dbstatus_options.html#sqlitedbstatuscachehit>`__, `SQLITE_DBSTATUS_CACHE_MISS <https://sqlite.org/c3ref/c_dbstatus_options.html#sqlitedbstatuscachemiss>`__, `SQLITE_DBSTATUS_CACHE_USED <https://sqlite.org/c3ref/c_dbstatus_options.html#sqlitedbstatuscacheused>`__, `SQLITE_DBSTATUS_CACHE_WRITE <https://sqlite.org/c3ref/c_dbstatus_options.html#sqlitedbstatuscachewrite>`__, `SQLITE_DBSTATUS_DEFERRED_FKS <https://sqlite.org/c3ref/c_dbstatus_options.html#sqlitedbstatusdeferredfks>`__, `SQLITE_DBSTATUS_LOOKASIDE_HIT <https://sqlite.org/c3ref/c_dbstatus_options.html#sqlitedbstatuslookasidehit>`__, `SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL <https://sqlite.org/c3ref/c_dbstatus_options.html#sqlitedbstatuslookasidemissfull>`__, `SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE <https://sqlite.org/c3ref/c_dbstatus_options.html#sqlitedbstatuslookasidemisssize>`__, `SQLITE_DBSTATUS_LOOKASIDE_USED <https://sqlite.org/c3ref/c_dbstatus_options.html#sqlitedbstatuslookasideused>`__, `SQLITE_DBSTATUS_MAX <https://sqlite.org/c3ref/c_dbstatus_options.html>`__, `SQLITE_DBSTATUS_SCHEMA_USED <https://sqlite.org/c3ref/c_dbstatus_options.html#sqlitedbstatusschemaused>`__, `SQLITE_DBSTATUS_STMT_USED <https://sqlite.org/c3ref/c_dbstatus_options.html#sqlitedbstatusstmtused>`__

mapping_device_characteristics `Device Characteristics <https://sqlite.org/c3ref/c_iocap_atomic.html>`__

    `SQLITE_IOCAP_ATOMIC <https://sqlite.org/c3ref/c_iocap_atomic.html>`__, `SQLITE_IOCAP_ATOMIC16K <https://sqlite.org/c3ref/c_iocap_atomic.html>`__, `SQLITE_IOCAP_ATOMIC1K <https://sqlite.org/c3ref/c_iocap_atomic.html>`__, `SQLITE_IOCAP_ATOMIC2K <https://sqlite.org/c3ref/c_iocap_atomic.html>`__, `SQLITE_IOCAP_ATOMIC32K <https://sqlite.org/c3ref/c_iocap_atomic.html>`__, `SQLITE_IOCAP_ATOMIC4K <https://sqlite.org/c3ref/c_iocap_atomic.html>`__, `SQLITE_IOCAP_ATOMIC512 <https://sqlite.org/c3ref/c_iocap_atomic.html>`__, `SQLITE_IOCAP_ATOMIC64K <https://sqlite.org/c3ref/c_iocap_atomic.html>`__, `SQLITE_IOCAP_ATOMIC8K <https://sqlite.org/c3ref/c_iocap_atomic.html>`__, `SQLITE_IOCAP_IMMUTABLE <https://sqlite.org/c3ref/c_iocap_atomic.html>`__, `SQLITE_IOCAP_POWERSAFE_OVERWRITE <https://sqlite.org/c3ref/c_iocap_atomic.html>`__, `SQLITE_IOCAP_SAFE_APPEND <https://sqlite.org/c3ref/c_iocap_atomic.html>`__, `SQLITE_IOCAP_SEQUENTIAL <https://sqlite.org/c3ref/c_iocap_atomic.html>`__, `SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN <https://sqlite.org/c3ref/c_iocap_atomic.html>`__

mapping_extended_result_codes `Extended Result Codes <https://sqlite.org/rescode.html>`__

    `SQLITE_ABORT_ROLLBACK <https://sqlite.org/rescode.html#abort_rollback>`__, `SQLITE_AUTH_USER <https://sqlite.org/c3ref/c_abort_rollback.html>`__, `SQLITE_BUSY_RECOVERY <https://sqlite.org/rescode.html#busy_recovery>`__, `SQLITE_BUSY_SNAPSHOT <https://sqlite.org/rescode.html#busy_snapshot>`__, `SQLITE_CANTOPEN_CONVPATH <https://sqlite.org/rescode.html#cantopen_convpath>`__, `SQLITE_CANTOPEN_FULLPATH <https://sqlite.org/rescode.html#cantopen_fullpath>`__, `SQLITE_CANTOPEN_ISDIR <https://sqlite.org/rescode.html#cantopen_isdir>`__, `SQLITE_CANTOPEN_NOTEMPDIR <https://sqlite.org/rescode.html#cantopen_notempdir>`__, `SQLITE_CONSTRAINT_CHECK <https://sqlite.org/rescode.html#constraint_check>`__, `SQLITE_CONSTRAINT_COMMITHOOK <https://sqlite.org/rescode.html#constraint_commithook>`__, `SQLITE_CONSTRAINT_FOREIGNKEY <https://sqlite.org/rescode.html#constraint_foreignkey>`__, `SQLITE_CONSTRAINT_FUNCTION <https://sqlite.org/rescode.html#constraint_function>`__, `SQLITE_CONSTRAINT_NOTNULL <https://sqlite.org/rescode.html#constraint_notnull>`__, `SQLITE_CONSTRAINT_PRIMARYKEY <https://sqlite.org/rescode.html#constraint_primarykey>`__, `SQLITE_CONSTRAINT_ROWID <https://sqlite.org/rescode.html#constraint_rowid>`__, `SQLITE_CONSTRAINT_TRIGGER <https://sqlite.org/rescode.html#constraint_trigger>`__, `SQLITE_CONSTRAINT_UNIQUE <https://sqlite.org/rescode.html#constraint_unique>`__, `SQLITE_CONSTRAINT_VTAB <https://sqlite.org/rescode.html#constraint_vtab>`__, `SQLITE_CORRUPT_VTAB <https://sqlite.org/rescode.html#corrupt_vtab>`__, `SQLITE_IOERR_ACCESS <https://sqlite.org/rescode.html#ioerr_access>`__, `SQLITE_IOERR_BLOCKED <https://sqlite.org/rescode.html#ioerr_blocked>`__, `SQLITE_IOERR_CHECKRESERVEDLOCK <https://sqlite.org/rescode.html#ioerr_checkreservedlock>`__, `SQLITE_IOERR_CLOSE <https://sqlite.org/rescode.html#ioerr_close>`__, `SQLITE_IOERR_CONVPATH <https://sqlite.org/rescode.html#ioerr_convpath>`__, `SQLITE_IOERR_DELETE <https://sqlite.org/rescode.html#ioerr_delete>`__, `SQLITE_IOERR_DELETE_NOENT <https://sqlite.org/rescode.html#ioerr_delete_noent>`__, `SQLITE_IOERR_DIR_CLOSE <https://sqlite.org/rescode.html#ioerr_dir_close>`__, `SQLITE_IOERR_DIR_FSYNC <https://sqlite.org/rescode.html#ioerr_dir_fsync>`__, `SQLITE_IOERR_FSTAT <https://sqlite.org/rescode.html#ioerr_fstat>`__, `SQLITE_IOERR_FSYNC <https://sqlite.org/rescode.html#ioerr_fsync>`__, `SQLITE_IOERR_GETTEMPPATH <https://sqlite.org/rescode.html#ioerr_gettemppath>`__, `SQLITE_IOERR_LOCK <https://sqlite.org/rescode.html#ioerr_lock>`__, `SQLITE_IOERR_MMAP <https://sqlite.org/rescode.html#ioerr_mmap>`__, `SQLITE_IOERR_NOMEM <https://sqlite.org/rescode.html#ioerr_nomem>`__, `SQLITE_IOERR_RDLOCK <https://sqlite.org/rescode.html#ioerr_rdlock>`__, `SQLITE_IOERR_READ <https://sqlite.org/rescode.html#ioerr_read>`__, `SQLITE_IOERR_SEEK <https://sqlite.org/rescode.html#ioerr_seek>`__, `SQLITE_IOERR_SHMLOCK <https://sqlite.org/rescode.html#ioerr_shmlock>`__, `SQLITE_IOERR_SHMMAP <https://sqlite.org/rescode.html#ioerr_shmmap>`__, `SQLITE_IOERR_SHMOPEN <https://sqlite.org/rescode.html#ioerr_shmopen>`__, `SQLITE_IOERR_SHMSIZE <https://sqlite.org/rescode.html#ioerr_shmsize>`__, `SQLITE_IOERR_SHORT_READ <https://sqlite.org/rescode.html#ioerr_short_read>`__, `SQLITE_IOERR_TRUNCATE <https://sqlite.org/rescode.html#ioerr_truncate>`__, `SQLITE_IOERR_UNLOCK <https://sqlite.org/rescode.html#ioerr_unlock>`__, `SQLITE_IOERR_WRITE <https://sqlite.org/rescode.html#ioerr_write>`__, `SQLITE_LOCKED_SHAREDCACHE <https://sqlite.org/rescode.html#locked_sharedcache>`__, `SQLITE_NOTICE_RECOVER_ROLLBACK <https://sqlite.org/rescode.html#notice_recover_rollback>`__, `SQLITE_NOTICE_RECOVER_WAL <https://sqlite.org/rescode.html#notice_recover_wal>`__, `SQLITE_READONLY_CANTLOCK <https://sqlite.org/rescode.html#readonly_cantlock>`__, `SQLITE_READONLY_DBMOVED <https://sqlite.org/rescode.html#readonly_dbmoved>`__, `SQLITE_READONLY_RECOVERY <https://sqlite.org/rescode.html#readonly_recovery>`__, `SQLITE_READONLY_ROLLBACK <https://sqlite.org/rescode.html#readonly_rollback>`__, `SQLITE_WARNING_AUTOINDEX <https://sqlite.org/rescode.html#warning_autoindex>`__

mapping_file_control `Standard File Control Opcodes <https://sqlite.org/c3ref/c_fcntl_busyhandler.html>`__

    `SQLITE_FCNTL_BUSYHANDLER <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlbusyhandler>`__, `SQLITE_FCNTL_CHUNK_SIZE <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlchunksize>`__, `SQLITE_FCNTL_COMMIT_PHASETWO <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlcommitphasetwo>`__, `SQLITE_FCNTL_FILE_POINTER <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlfilepointer>`__, `SQLITE_FCNTL_GET_LOCKPROXYFILE <https://sqlite.org/c3ref/c_fcntl_busyhandler.html>`__, `SQLITE_FCNTL_HAS_MOVED <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlhasmoved>`__, `SQLITE_FCNTL_LAST_ERRNO <https://sqlite.org/c3ref/c_fcntl_busyhandler.html>`__, `SQLITE_FCNTL_LOCKSTATE <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntllockstate>`__, `SQLITE_FCNTL_MMAP_SIZE <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlmmapsize>`__, `SQLITE_FCNTL_OVERWRITE <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntloverwrite>`__, `SQLITE_FCNTL_PERSIST_WAL <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlpersistwal>`__, `SQLITE_FCNTL_POWERSAFE_OVERWRITE <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlpowersafeoverwrite>`__, `SQLITE_FCNTL_PRAGMA <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlpragma>`__, `SQLITE_FCNTL_RBU <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlrbu>`__, `SQLITE_FCNTL_SET_LOCKPROXYFILE <https://sqlite.org/c3ref/c_fcntl_busyhandler.html>`__, `SQLITE_FCNTL_SIZE_HINT <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlsizehint>`__, `SQLITE_FCNTL_SYNC <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlsync>`__, `SQLITE_FCNTL_SYNC_OMITTED <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlsyncomitted>`__, `SQLITE_FCNTL_TEMPFILENAME <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntltempfilename>`__, `SQLITE_FCNTL_TRACE <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntltrace>`__, `SQLITE_FCNTL_VFSNAME <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlvfsname>`__, `SQLITE_FCNTL_WAL_BLOCK <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlwalblock>`__, `SQLITE_FCNTL_WIN32_AV_RETRY <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlwin32avretry>`__, `SQLITE_FCNTL_WIN32_SET_HANDLE <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlwin32sethandle>`__, `SQLITE_FCNTL_ZIPVFS <https://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlzipvfs>`__

mapping_limits `Run-Time Limit Categories <https://sqlite.org/c3ref/c_limit_attached.html>`__

    `SQLITE_LIMIT_ATTACHED <https://sqlite.org/c3ref/c_limit_attached.html#sqlitelimitattached>`__, `SQLITE_LIMIT_COLUMN <https://sqlite.org/c3ref/c_limit_attached.html#sqlitelimitcolumn>`__, `SQLITE_LIMIT_COMPOUND_SELECT <https://sqlite.org/c3ref/c_limit_attached.html#sqlitelimitcompoundselect>`__, `SQLITE_LIMIT_EXPR_DEPTH <https://sqlite.org/c3ref/c_limit_attached.html#sqlitelimitexprdepth>`__, `SQLITE_LIMIT_FUNCTION_ARG <https://sqlite.org/c3ref/c_limit_attached.html#sqlitelimitfunctionarg>`__, `SQLITE_LIMIT_LENGTH <https://sqlite.org/c3ref/c_limit_attached.html#sqlitelimitlength>`__, `SQLITE_LIMIT_LIKE_PATTERN_LENGTH <https://sqlite.org/c3ref/c_limit_attached.html#sqlitelimitlikepatternlength>`__, `SQLITE_LIMIT_SQL_LENGTH <https://sqlite.org/c3ref/c_limit_attached.html#sqlitelimitsqllength>`__, `SQLITE_LIMIT_TRIGGER_DEPTH <https://sqlite.org/c3ref/c_limit_attached.html#sqlitelimittriggerdepth>`__, `SQLITE_LIMIT_VARIABLE_NUMBER <https://sqlite.org/c3ref/c_limit_attached.html#sqlitelimitvariablenumber>`__, `SQLITE_LIMIT_VDBE_OP <https://sqlite.org/c3ref/c_limit_attached.html#sqlitelimitvdbeop>`__, `SQLITE_LIMIT_WORKER_THREADS <https://sqlite.org/c3ref/c_limit_attached.html#sqlitelimitworkerthreads>`__

mapping_locking_level `File Locking Levels <https://sqlite.org/c3ref/c_lock_exclusive.html>`__

    `SQLITE_LOCK_EXCLUSIVE <https://sqlite.org/c3ref/c_lock_exclusive.html>`__, `SQLITE_LOCK_NONE <https://sqlite.org/c3ref/c_lock_exclusive.html>`__, `SQLITE_LOCK_PENDING <https://sqlite.org/c3ref/c_lock_exclusive.html>`__, `SQLITE_LOCK_RESERVED <https://sqlite.org/c3ref/c_lock_exclusive.html>`__, `SQLITE_LOCK_SHARED <https://sqlite.org/c3ref/c_lock_exclusive.html>`__

mapping_open_flags `Flags For File Open Operations <https://sqlite.org/c3ref/c_open_autoproxy.html>`__

    `SQLITE_OPEN_AUTOPROXY <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_CREATE <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_DELETEONCLOSE <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_EXCLUSIVE <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_FULLMUTEX <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_MAIN_DB <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_MAIN_JOURNAL <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_MASTER_JOURNAL <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_MEMORY <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_NOMUTEX <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_PRIVATECACHE <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_READONLY <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_READWRITE <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_SHAREDCACHE <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_SUBJOURNAL <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_TEMP_DB <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_TEMP_JOURNAL <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_TRANSIENT_DB <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_URI <https://sqlite.org/c3ref/c_open_autoproxy.html>`__, `SQLITE_OPEN_WAL <https://sqlite.org/c3ref/c_open_autoproxy.html>`__

mapping_result_codes `Result Codes <https://sqlite.org/rescode.html>`__

    `SQLITE_ABORT <https://sqlite.org/rescode.html#abort>`__, `SQLITE_AUTH <https://sqlite.org/rescode.html#auth>`__, `SQLITE_BUSY <https://sqlite.org/rescode.html#busy>`__, `SQLITE_CANTOPEN <https://sqlite.org/rescode.html#cantopen>`__, `SQLITE_CONSTRAINT <https://sqlite.org/rescode.html#constraint>`__, `SQLITE_CORRUPT <https://sqlite.org/rescode.html#corrupt>`__, `SQLITE_DONE <https://sqlite.org/rescode.html#done>`__, `SQLITE_EMPTY <https://sqlite.org/rescode.html#empty>`__, `SQLITE_ERROR <https://sqlite.org/rescode.html#error>`__, `SQLITE_FORMAT <https://sqlite.org/rescode.html#format>`__, `SQLITE_FULL <https://sqlite.org/rescode.html#full>`__, `SQLITE_INTERNAL <https://sqlite.org/rescode.html#internal>`__, `SQLITE_INTERRUPT <https://sqlite.org/rescode.html#interrupt>`__, `SQLITE_IOERR <https://sqlite.org/rescode.html#ioerr>`__, `SQLITE_LOCKED <https://sqlite.org/rescode.html#locked>`__, `SQLITE_MISMATCH <https://sqlite.org/rescode.html#mismatch>`__, `SQLITE_MISUSE <https://sqlite.org/rescode.html#misuse>`__, `SQLITE_NOLFS <https://sqlite.org/rescode.html#nolfs>`__, `SQLITE_NOMEM <https://sqlite.org/rescode.html#nomem>`__, `SQLITE_NOTADB <https://sqlite.org/rescode.html#notadb>`__, `SQLITE_NOTFOUND <https://sqlite.org/rescode.html#notfound>`__, `SQLITE_NOTICE <https://sqlite.org/rescode.html#notice>`__, `SQLITE_OK <https://sqlite.org/rescode.html#ok>`__, `SQLITE_PERM <https://sqlite.org/rescode.html#perm>`__, `SQLITE_PROTOCOL <https://sqlite.org/rescode.html#protocol>`__, `SQLITE_RANGE <https://sqlite.org/rescode.html#range>`__, `SQLITE_READONLY <https://sqlite.org/rescode.html#readonly>`__, `SQLITE_ROW <https://sqlite.org/rescode.html#row>`__, `SQLITE_SCHEMA <https://sqlite.org/rescode.html#schema>`__, `SQLITE_TOOBIG <https://sqlite.org/rescode.html#toobig>`__, `SQLITE_WARNING <https://sqlite.org/rescode.html#warning>`__

mapping_status `Status Parameters <https://sqlite.org/c3ref/c_status_malloc_count.html>`__

    `SQLITE_STATUS_MALLOC_COUNT <https://sqlite.org/c3ref/c_status_malloc_count.html#sqlitestatusmalloccount>`__, `SQLITE_STATUS_MALLOC_SIZE <https://sqlite.org/c3ref/c_status_malloc_count.html#sqlitestatusmallocsize>`__, `SQLITE_STATUS_MEMORY_USED <https://sqlite.org/c3ref/c_status_malloc_count.html#sqlitestatusmemoryused>`__, `SQLITE_STATUS_PAGECACHE_OVERFLOW <https://sqlite.org/c3ref/c_status_malloc_count.html#sqlitestatuspagecacheoverflow>`__, `SQLITE_STATUS_PAGECACHE_SIZE <https://sqlite.org/c3ref/c_status_malloc_count.html#sqlitestatuspagecachesize>`__, `SQLITE_STATUS_PAGECACHE_USED <https://sqlite.org/c3ref/c_status_malloc_count.html#sqlitestatuspagecacheused>`__, `SQLITE_STATUS_PARSER_STACK <https://sqlite.org/c3ref/c_status_malloc_count.html#sqlitestatusparserstack>`__, `SQLITE_STATUS_SCRATCH_OVERFLOW <https://sqlite.org/c3ref/c_status_malloc_count.html#sqlitestatusscratchoverflow>`__, `SQLITE_STATUS_SCRATCH_SIZE <https://sqlite.org/c3ref/c_status_malloc_count.html#sqlitestatusscratchsize>`__, `SQLITE_STATUS_SCRATCH_USED <https://sqlite.org/c3ref/c_status_malloc_count.html#sqlitestatusscratchused>`__

mapping_sync `Synchronization Type Flags <https://sqlite.org/c3ref/c_sync_dataonly.html>`__

    `SQLITE_SYNC_DATAONLY <https://sqlite.org/c3ref/c_sync_dataonly.html>`__, `SQLITE_SYNC_FULL <https://sqlite.org/c3ref/c_sync_dataonly.html>`__, `SQLITE_SYNC_NORMAL <https://sqlite.org/c3ref/c_sync_dataonly.html>`__

mapping_virtual_table_configuration_options `Virtual Table Configuration Options <https://sqlite.org/c3ref/c_vtab_constraint_support.html>`__

    `SQLITE_VTAB_CONSTRAINT_SUPPORT <https://sqlite.org/c3ref/c_vtab_constraint_support.html>`__

mapping_wal_checkpoint `Checkpoint Mode Values <https://sqlite.org/c3ref/c_checkpoint_full.html>`__

    `SQLITE_CHECKPOINT_FULL <https://sqlite.org/c3ref/c_checkpoint_full.html>`__, `SQLITE_CHECKPOINT_PASSIVE <https://sqlite.org/c3ref/c_checkpoint_full.html>`__, `SQLITE_CHECKPOINT_RESTART <https://sqlite.org/c3ref/c_checkpoint_full.html>`__, `SQLITE_CHECKPOINT_TRUNCATE <https://sqlite.org/c3ref/c_checkpoint_full.html>`__

mapping_xshmlock_flags `Flags for the xShmLock VFS method <https://sqlite.org/c3ref/c_shm_exclusive.html>`__

    `SQLITE_SHM_EXCLUSIVE <https://sqlite.org/c3ref/c_shm_exclusive.html>`__, `SQLITE_SHM_LOCK <https://sqlite.org/c3ref/c_shm_exclusive.html>`__, `SQLITE_SHM_SHARED <https://sqlite.org/c3ref/c_shm_exclusive.html>`__, `SQLITE_SHM_UNLOCK <https://sqlite.org/c3ref/c_shm_exclusive.html>`__

