chunk_id stringlengths 36 36 | source stringclasses 35
values | source_url stringlengths 0 290 | upstream_license stringclasses 1
value | document_id stringlengths 36 36 | chunk_index int64 0 324k | retrieved_at stringclasses 2
values | chunker_version stringclasses 4
values | content_hash stringlengths 15 64 | content stringlengths 50 44.7k | namespace stringclasses 9
values | source_name stringclasses 35
values | raw_text stringlengths 50 44.7k | cleaned_text stringlengths 50 44.7k | tags stringclasses 49
values | collection_name stringclasses 11
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2e6f6ba7-75d8-441b-82a6-71d5fd5c19be | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,926 | supabase-export-v2 | 227f35ea8afe633f | # 2) Parse using column names con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_COLNAMES) cur = con.execute("CREATE TABLE test(p)")
cur.execute("INSERT INTO test(p) VALUES(?)", (p,))
cur.execute('SELECT p AS "p [point]" FROM test')
print("with column names:", cur.fetchone()[0])
cur.close()
con.close() | trusted_official_docs | CPython Docs | # 2) Parse using column names con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_COLNAMES) cur = con.execute("CREATE TABLE test(p)")
cur.execute("INSERT INTO test(p) VALUES(?)", (p,))
cur.execute('SELECT p AS "p [point]" FROM test')
print("with column names:", cur.fetchone()[0])
cur.close()
con.close() | # 2) Parse using column names con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_COLNAMES) cur = con.execute("CREATE TABLE test(p)")
cur.execute("INSERT INTO test(p) VALUES(?)", (p,))
cur.execute('SELECT p AS "p [point]" FROM test')
print("with column names:", cur.fetchone()[0])
cur.close()
con.close() | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2e8b4737-c5da-4b79-abac-eb5d102e67df | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,875 | supabase-export-v2 | 22af9c2f8333940e | they are vulnerable to `SQL injection attacks`_. For example, an attacker can simply close the single quote and inject ``OR TRUE`` to select all rows::
>>> # Never do this -- insecure! >>> symbol = input()
' OR TRUE; --
>>> sql = "SELECT * FROM stocks WHERE symbol = '%s'" % symbol
>>> print(sql)
SELECT * FROM stock... | trusted_official_docs | CPython Docs | they are vulnerable to `SQL injection attacks`_. For example, an attacker can simply close the single quote and inject ``OR TRUE`` to select all rows::
>>> # Never do this -- insecure! >>> symbol = input()
' OR TRUE; --
>>> sql = "SELECT * FROM stocks WHERE symbol = '%s'" % symbol
>>> print(sql)
SELECT * FROM stock... | they are vulnerable to `SQL injection attacks`_. For example, an attacker can simply close the single quote and inject ``OR TRUE`` to select all rows::
>>> # Never do this -- insecure! >>> symbol = input()
' OR TRUE; --
>>> sql = "SELECT * FROM stocks WHERE symbol = '%s'" % symbol
>>> print(sql)
SELECT * FROM stock... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2e9330b5-8709-4985-b2d3-28e8ee27ef96 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 4,024 | supabase-export-v2 | ecf8166d42da396b | Transaction control via the ``autocommit`` attribute """"""""""""""""""""""""""""""""""""""""""""""""""""
The recommended way of controlling transaction behaviour is through
the :attr:`Connection.autocommit` attribute,
which should preferably be set using the *autocommit* parameter
of :func:`connect`. | trusted_official_docs | CPython Docs | Transaction control via the ``autocommit`` attribute """"""""""""""""""""""""""""""""""""""""""""""""""""
The recommended way of controlling transaction behaviour is through
the :attr:`Connection.autocommit` attribute,
which should preferably be set using the *autocommit* parameter
of :func:`connect`. | Transaction control via the ``autocommit`` attribute """"""""""""""""""""""""""""""""""""""""""""""""""""
The recommended way of controlling transaction behaviour is through
the :attr:`Connection.autocommit` attribute,
which should preferably be set using the *autocommit* parameter
of :func:`connect`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
2f571ff2-8450-4802-b471-f6a57eb5e7fd | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,484 | supabase-export-v2 | 0bcd62b361ff0ae4 | .. method:: cursor(factory=Cursor)
Create and return a :class:`Cursor` object. The cursor method accepts a single optional parameter *factory*. If
supplied, this must be a :term:`callable` returning
an instance of :class:`Cursor` or its subclasses. | trusted_official_docs | CPython Docs | .. method:: cursor(factory=Cursor)
Create and return a :class:`Cursor` object. The cursor method accepts a single optional parameter *factory*. If
supplied, this must be a :term:`callable` returning
an instance of :class:`Cursor` or its subclasses. | .. method:: cursor(factory=Cursor)
Create and return a :class:`Cursor` object. The cursor method accepts a single optional parameter *factory*. If
supplied, this must be a :term:`callable` returning
an instance of :class:`Cursor` or its subclasses. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
33046d07-62a8-4c2f-841a-57422a02edd2 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,602 | supabase-export-v2 | 6fb6d43730eaf3ae | :param entrypoint:
Entry point name. If ``None`` (the default),
SQLite will come up with an entry point name of its own;
see the SQLite docs `Loading an Extension`_ for details. | trusted_official_docs | CPython Docs | :param entrypoint:
Entry point name. If ``None`` (the default),
SQLite will come up with an entry point name of its own;
see the SQLite docs `Loading an Extension`_ for details. | :param entrypoint:
Entry point name. If ``None`` (the default),
SQLite will come up with an entry point name of its own;
see the SQLite docs `Loading an Extension`_ for details. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
33ad3e0d-423d-487b-b6b9-f5e20b080a4c | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,887 | supabase-export-v2 | fb513929ab3ea60e | set of data types natively. To store custom Python types in SQLite databases, *adapt* them to one of the :ref:`Python types SQLite natively understands <sqlite3-types>`.
There are two ways to adapt Python objects to SQLite types:
letting your object adapt itself, or using an *adapter callable*. The latter will take pre... | trusted_official_docs | CPython Docs | set of data types natively. To store custom Python types in SQLite databases, *adapt* them to one of the :ref:`Python types SQLite natively understands <sqlite3-types>`.
There are two ways to adapt Python objects to SQLite types:
letting your object adapt itself, or using an *adapter callable*. The latter will take pre... | set of data types natively. To store custom Python types in SQLite databases, *adapt* them to one of the :ref:`Python types SQLite natively understands <sqlite3-types>`.
There are two ways to adapt Python objects to SQLite types:
letting your object adapt itself, or using an *adapter callable*. The latter will take pre... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
345a0680-419a-4157-a035-5a0b9d778b3c | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,540 | supabase-export-v2 | 3e92aa21cb3159f3 | Set to ``None`` to remove an existing SQL aggregate window function.
:raises NotSupportedError:
If used with a version of SQLite older than 3.25.0,
which does not support aggregate window functions. | trusted_official_docs | CPython Docs | Set to ``None`` to remove an existing SQL aggregate window function.
:raises NotSupportedError:
If used with a version of SQLite older than 3.25.0,
which does not support aggregate window functions. | Set to ``None`` to remove an existing SQL aggregate window function.
:raises NotSupportedError:
If used with a version of SQLite older than 3.25.0,
which does not support aggregate window functions. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
35b9744b-6717-4d20-b5f4-47b0bc02df78 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,380 | supabase-export-v2 | d141a83910763cb7 | .. doctest::
>>> for row in cur.execute("SELECT year, title FROM movie ORDER BY year"):
... print(row)
(1971, 'And Now for Something Completely Different')
(1975, 'Monty Python and the Holy Grail')
(1979, "Monty Python's Life of Brian")
(1982, 'Monty Python Live at the Hollywood Bowl')
(1983, "Monty Python's The ... | trusted_official_docs | CPython Docs | .. doctest::
>>> for row in cur.execute("SELECT year, title FROM movie ORDER BY year"):
... print(row)
(1971, 'And Now for Something Completely Different')
(1975, 'Monty Python and the Holy Grail')
(1979, "Monty Python's Life of Brian")
(1982, 'Monty Python Live at the Hollywood Bowl')
(1983, "Monty Python's The ... | .. doctest::
>>> for row in cur.execute("SELECT year, title FROM movie ORDER BY year"):
... print(row)
(1971, 'And Now for Something Completely Different')
(1975, 'Monty Python and the Holy Grail')
(1979, "Monty Python's Life of Brian")
(1982, 'Monty Python Live at the Hollywood Bowl')
(1983, "Monty Python's The ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
36b2274f-4914-432e-bd16-133ca583298f | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,844 | supabase-export-v2 | d7da24c9ca502349 | .. exception:: NotSupportedError
Exception raised in case a method or database API is not supported by the
underlying SQLite library. For example, setting *deterministic* to
``True`` in :meth:`~Connection.create_function`, if the underlying SQLite library
does not support deterministic functions. ``NotSupportedError... | trusted_official_docs | CPython Docs | .. exception:: NotSupportedError
Exception raised in case a method or database API is not supported by the
underlying SQLite library. For example, setting *deterministic* to
``True`` in :meth:`~Connection.create_function`, if the underlying SQLite library
does not support deterministic functions. ``NotSupportedError... | .. exception:: NotSupportedError
Exception raised in case a method or database API is not supported by the
underlying SQLite library. For example, setting *deterministic* to
``True`` in :meth:`~Connection.create_function`, if the underlying SQLite library
does not support deterministic functions. ``NotSupportedError... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
39ccdc7a-c29a-4039-a46a-94a8b4296d8b | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,801 | supabase-export-v2 | 2453a49c7b164881 | with con.blobopen("test", "blob_col", 1) as blob: blob.write(b"hello, ") blob.write(b"world.") # Modify the first and last bytes of our blob blob[0] = ord("H") blob[-1] = ord("!")
# Read the contents of our blob
with con.blobopen("test", "blob_col", 1) as blob:
greeting = blob.read() | trusted_official_docs | CPython Docs | with con.blobopen("test", "blob_col", 1) as blob: blob.write(b"hello, ") blob.write(b"world.") # Modify the first and last bytes of our blob blob[0] = ord("H") blob[-1] = ord("!")
# Read the contents of our blob
with con.blobopen("test", "blob_col", 1) as blob:
greeting = blob.read() | with con.blobopen("test", "blob_col", 1) as blob: blob.write(b"hello, ") blob.write(b"world.") # Modify the first and last bytes of our blob blob[0] = ord("H") blob[-1] = ord("!")
# Read the contents of our blob
with con.blobopen("test", "blob_col", 1) as blob:
greeting = blob.read() | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3ad0c066-6922-4fd0-a964-3a3ff2e754e6 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,789 | supabase-export-v2 | 0cb4c2b692e8b399 | :class:`!Row` instance serves as a highly optimized :attr:`~Connection.row_factory` for :class:`Connection` objects. It supports iteration, equality testing, :func:`len`, and :term:`mapping` access by column name and index.
Two :class:`!Row` objects compare equal
if they have identical column names and values. | trusted_official_docs | CPython Docs | :class:`!Row` instance serves as a highly optimized :attr:`~Connection.row_factory` for :class:`Connection` objects. It supports iteration, equality testing, :func:`len`, and :term:`mapping` access by column name and index.
Two :class:`!Row` objects compare equal
if they have identical column names and values. | :class:`!Row` instance serves as a highly optimized :attr:`~Connection.row_factory` for :class:`Connection` objects. It supports iteration, equality testing, :func:`len`, and :term:`mapping` access by column name and index.
Two :class:`!Row` objects compare equal
if they have identical column names and values. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3bfe3c7e-2ce1-4e80-9f10-6e97b4446ed8 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,426 | supabase-export-v2 | 41ad4522f788650f | .. function:: register_converter(typename, converter, /)
Register the *converter* :term:`callable` to convert SQLite objects of type
*typename* into a Python object of a specific type. The converter is invoked for all SQLite values of type *typename*;
it is passed a :class:`bytes` object and should return an object o... | trusted_official_docs | CPython Docs | .. function:: register_converter(typename, converter, /)
Register the *converter* :term:`callable` to convert SQLite objects of type
*typename* into a Python object of a specific type. The converter is invoked for all SQLite values of type *typename*;
it is passed a :class:`bytes` object and should return an object o... | .. function:: register_converter(typename, converter, /)
Register the *converter* :term:`callable` to convert SQLite objects of type
*typename* into a Python object of a specific type. The converter is invoked for all SQLite values of type *typename*;
it is passed a :class:`bytes` object and should return an object o... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3cc909fc-7caa-4f2b-a4f3-b072bd1df283 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,424 | supabase-export-v2 | 3998827abe8368c1 | .. function:: register_adapter(type, adapter, /)
Register an *adapter* :term:`callable` to adapt the Python type *type*
into an SQLite type. The adapter is called with a Python object of type *type* as its sole
argument, and must return a value of a
:ref:`type that SQLite natively understands <sqlite3-types>`. | trusted_official_docs | CPython Docs | .. function:: register_adapter(type, adapter, /)
Register an *adapter* :term:`callable` to adapt the Python type *type*
into an SQLite type. The adapter is called with a Python object of type *type* as its sole
argument, and must return a value of a
:ref:`type that SQLite natively understands <sqlite3-types>`. | .. function:: register_adapter(type, adapter, /)
Register an *adapter* :term:`callable` to adapt the Python type *type*
into an SQLite type. The adapter is called with a Python object of type *type* as its sole
argument, and must return a value of a
:ref:`type that SQLite natively understands <sqlite3-types>`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3d564182-b532-4dad-ab75-1db4b160787c | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,585 | supabase-export-v2 | 0a4cd27d29558c03 | .. method:: enable_load_extension(enabled, /)
Enable the SQLite engine to load SQLite extensions from shared libraries
if *enabled* is ``True``;
else, disallow loading SQLite extensions. SQLite extensions can define new functions,
aggregates or whole new virtual table implementations. One well-known
extension is th... | trusted_official_docs | CPython Docs | .. method:: enable_load_extension(enabled, /)
Enable the SQLite engine to load SQLite extensions from shared libraries
if *enabled* is ``True``;
else, disallow loading SQLite extensions. SQLite extensions can define new functions,
aggregates or whole new virtual table implementations. One well-known
extension is th... | .. method:: enable_load_extension(enabled, /)
Enable the SQLite engine to load SQLite extensions from shared libraries
if *enabled* is ``True``;
else, disallow loading SQLite extensions. SQLite extensions can define new functions,
aggregates or whole new virtual table implementations. One well-known
extension is th... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3ec80e02-3e85-4ca9-acbc-28ee9a02859e | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,378 | supabase-export-v2 | 48facf74776fe90a | Always use placeholders instead of :ref:`string formatting <tut-formatting>` to bind Python values to SQL statements, to avoid `SQL injection attacks`_ (see :ref:`sqlite3-placeholders` for more details).
We can verify that the new rows were inserted
by executing a ``SELECT`` query,
this time iterating over the results ... | trusted_official_docs | CPython Docs | Always use placeholders instead of :ref:`string formatting <tut-formatting>` to bind Python values to SQL statements, to avoid `SQL injection attacks`_ (see :ref:`sqlite3-placeholders` for more details).
We can verify that the new rows were inserted
by executing a ``SELECT`` query,
this time iterating over the results ... | Always use placeholders instead of :ref:`string formatting <tut-formatting>` to bind Python values to SQL statements, to avoid `SQL injection attacks`_ (see :ref:`sqlite3-placeholders` for more details).
We can verify that the new rows were inserted
by executing a ``SELECT`` query,
this time iterating over the results ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3f8c8285-421c-4c2c-8563-8ecfb4ddb987 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,621 | supabase-export-v2 | f3cae62720297563 | :param ~sqlite3.Connection target: The database connection to save the backup to.
:param int pages:
The number of pages to copy at a time. If equal to or less than ``0``,
the entire database is copied in a single step. Defaults to ``-1``. | trusted_official_docs | CPython Docs | :param ~sqlite3.Connection target: The database connection to save the backup to.
:param int pages:
The number of pages to copy at a time. If equal to or less than ``0``,
the entire database is copied in a single step. Defaults to ``-1``. | :param ~sqlite3.Connection target: The database connection to save the backup to.
:param int pages:
The number of pages to copy at a time. If equal to or less than ``0``,
the entire database is copied in a single step. Defaults to ``-1``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
3fe58750-0458-4bae-a823-211bb2f65e9b | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,776 | supabase-export-v2 | 3c2a0fc48a5d399b | .. attribute:: lastrowid
Read-only attribute that provides the row id of the last inserted row. It
is only updated after successful ``INSERT`` or ``REPLACE`` statements
using the :meth:`execute` method. For other statements, after
:meth:`executemany` or :meth:`executescript`, or if the insertion failed,
the value o... | trusted_official_docs | CPython Docs | .. attribute:: lastrowid
Read-only attribute that provides the row id of the last inserted row. It
is only updated after successful ``INSERT`` or ``REPLACE`` statements
using the :meth:`execute` method. For other statements, after
:meth:`executemany` or :meth:`executescript`, or if the insertion failed,
the value o... | .. attribute:: lastrowid
Read-only attribute that provides the row id of the last inserted row. It
is only updated after successful ``INSERT`` or ``REPLACE`` statements
using the :meth:`execute` method. For other statements, after
:meth:`executemany` or :meth:`executescript`, or if the insertion failed,
the value o... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
408cf5e1-ce2f-451f-88ef-791ffa544f3e | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,404 | supabase-export-v2 | d5b8cac4c97ad2de | :param int cached_statements: The number of statements that :mod:`!sqlite3` should internally cache for this connection, to avoid parsing overhead. By default, 128 statements.
:param bool uri:
If set to ``True``, *database* is interpreted as a
:abbr:`URI (Uniform Resource Identifier)` with a file path
and an optiona... | trusted_official_docs | CPython Docs | :param int cached_statements: The number of statements that :mod:`!sqlite3` should internally cache for this connection, to avoid parsing overhead. By default, 128 statements.
:param bool uri:
If set to ``True``, *database* is interpreted as a
:abbr:`URI (Uniform Resource Identifier)` with a file path
and an optiona... | :param int cached_statements: The number of statements that :mod:`!sqlite3` should internally cache for this connection, to avoid parsing overhead. By default, 128 statements.
:param bool uri:
If set to ``True``, *database* is interpreted as a
:abbr:`URI (Uniform Resource Identifier)` with a file path
and an optiona... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
411b9cf4-478f-4018-8e66-17325aee2398 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,973 | supabase-export-v2 | 272918005e4ef137 | >>> con = sqlite3.connect("file:tutorial.db?mode=ro", uri=True) >>> con.execute("CREATE TABLE readonly(data)") Traceback (most recent call last): OperationalError: attempt to write a readonly database >>> con.close()
* Do not implicitly create a new database file if it does not already exist;
will raise :exc:`~sqlite3... | trusted_official_docs | CPython Docs | >>> con = sqlite3.connect("file:tutorial.db?mode=ro", uri=True) >>> con.execute("CREATE TABLE readonly(data)") Traceback (most recent call last): OperationalError: attempt to write a readonly database >>> con.close()
* Do not implicitly create a new database file if it does not already exist;
will raise :exc:`~sqlite3... | >>> con = sqlite3.connect("file:tutorial.db?mode=ro", uri=True) >>> con.execute("CREATE TABLE readonly(data)") Traceback (most recent call last): OperationalError: attempt to write a readonly database >>> con.close()
* Do not implicitly create a new database file if it does not already exist;
will raise :exc:`~sqlite3... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
43bec60e-83c6-43b7-aae2-43eea24429e6 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,397 | supabase-export-v2 | de99d88d12376e6b | Open a connection to an SQLite database.
:param database:
The path to the database file to be opened. You can pass ``":memory:"`` to create an `SQLite database existing only
in memory <https://sqlite.org/inmemorydb.html>`_, and open a connection
to it. :type database: :term:`path-like object` | trusted_official_docs | CPython Docs | Open a connection to an SQLite database.
:param database:
The path to the database file to be opened. You can pass ``":memory:"`` to create an `SQLite database existing only
in memory <https://sqlite.org/inmemorydb.html>`_, and open a connection
to it. :type database: :term:`path-like object` | Open a connection to an SQLite database.
:param database:
The path to the database file to be opened. You can pass ``":memory:"`` to create an `SQLite database existing only
in memory <https://sqlite.org/inmemorydb.html>`_, and open a connection
to it. :type database: :term:`path-like object` | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
43fe651f-35a8-45dc-a541-3ca9848af9f9 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,516 | supabase-export-v2 | 4ad4c8e9b83503a7 | .. doctest::
>>> import hashlib
>>> def md5sum(t):
... return hashlib.md5(t).hexdigest()
>>> con = sqlite3.connect(":memory:")
>>> con.create_function("md5", 1, md5sum)
>>> for row in con.execute("SELECT md5(?)", (b"foo",)):
... print(row)
('acbd18db4cc2f85cedef654fccc4a4d8',)
>>> con.close() | trusted_official_docs | CPython Docs | .. doctest::
>>> import hashlib
>>> def md5sum(t):
... return hashlib.md5(t).hexdigest()
>>> con = sqlite3.connect(":memory:")
>>> con.create_function("md5", 1, md5sum)
>>> for row in con.execute("SELECT md5(?)", (b"foo",)):
... print(row)
('acbd18db4cc2f85cedef654fccc4a4d8',)
>>> con.close() | .. doctest::
>>> import hashlib
>>> def md5sum(t):
... return hashlib.md5(t).hexdigest()
>>> con = sqlite3.connect(":memory:")
>>> con.create_function("md5", 1, md5sum)
>>> for row in con.execute("SELECT md5(?)", (b"foo",)):
... print(row)
('acbd18db4cc2f85cedef654fccc4a4d8',)
>>> con.close() | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
44db2b82-48ef-42a3-84ce-5992b4479439 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,355 | supabase-export-v2 | 459674dff009f1ca | cur = con.cursor()
Now that we've got a database connection and a cursor,
we can create a database table ``movie`` with columns for title,
release year, and review score. For simplicity, we can just use column names in the table declaration --
thanks to the `flexible typing`_ feature of SQLite,
specifying the data type... | trusted_official_docs | CPython Docs | cur = con.cursor()
Now that we've got a database connection and a cursor,
we can create a database table ``movie`` with columns for title,
release year, and review score. For simplicity, we can just use column names in the table declaration --
thanks to the `flexible typing`_ feature of SQLite,
specifying the data type... | cur = con.cursor()
Now that we've got a database connection and a cursor,
we can create a database table ``movie`` with columns for title,
release year, and review score. For simplicity, we can just use column names in the table declaration --
thanks to the `flexible typing`_ feature of SQLite,
specifying the data type... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
472cd5ef-a2d3-47b9-97e2-e85046846305 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,511 | supabase-export-v2 | ec050f78b27cf5cb | :param int narg: The number of arguments the SQL function can accept. If ``-1``, it may take any number of arguments.
:param func:
A :term:`callable` that is called when the SQL function is invoked. The callable must return :ref:`a type natively supported by SQLite
<sqlite3-types>`. Set to ``None`` to remove an exist... | trusted_official_docs | CPython Docs | :param int narg: The number of arguments the SQL function can accept. If ``-1``, it may take any number of arguments.
:param func:
A :term:`callable` that is called when the SQL function is invoked. The callable must return :ref:`a type natively supported by SQLite
<sqlite3-types>`. Set to ``None`` to remove an exist... | :param int narg: The number of arguments the SQL function can accept. If ``-1``, it may take any number of arguments.
:param func:
A :term:`callable` that is called when the SQL function is invoked. The callable must return :ref:`a type natively supported by SQLite
<sqlite3-types>`. Set to ``None`` to remove an exist... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
49cc0625-e727-4a30-9f51-ed67ac0949e6 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,865 | supabase-export-v2 | 97a45d4520afdfc8 | Command-line interface ^^^^^^^^^^^^^^^^^^^^^^
The :mod:`!sqlite3` module can be invoked as a script,
using the interpreter's :option:`-m` switch,
in order to provide a simple SQLite shell. The argument signature is as follows:: | trusted_official_docs | CPython Docs | Command-line interface ^^^^^^^^^^^^^^^^^^^^^^
The :mod:`!sqlite3` module can be invoked as a script,
using the interpreter's :option:`-m` switch,
in order to provide a simple SQLite shell. The argument signature is as follows:: | Command-line interface ^^^^^^^^^^^^^^^^^^^^^^
The :mod:`!sqlite3` module can be invoked as a script,
using the interpreter's :option:`-m` switch,
in order to provide a simple SQLite shell. The argument signature is as follows:: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
49db04b3-a0e9-4a71-a5bd-a031ad4ca146 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,726 | supabase-export-v2 | 2a2b2bdcb44d6237 | to placeholders in *sql*. A :class:`!dict` if named placeholders are used. A :term:`!sequence` if unnamed placeholders are used. See :ref:`sqlite3-placeholders`. :type parameters: :class:`dict` | :term:`sequence`
:raises ProgrammingError:
When *sql* contains more than one SQL statement. When :ref:`named placeholders <... | trusted_official_docs | CPython Docs | to placeholders in *sql*. A :class:`!dict` if named placeholders are used. A :term:`!sequence` if unnamed placeholders are used. See :ref:`sqlite3-placeholders`. :type parameters: :class:`dict` | :term:`sequence`
:raises ProgrammingError:
When *sql* contains more than one SQL statement. When :ref:`named placeholders <... | to placeholders in *sql*. A :class:`!dict` if named placeholders are used. A :term:`!sequence` if unnamed placeholders are used. See :ref:`sqlite3-placeholders`. :type parameters: :class:`dict` | :term:`sequence`
:raises ProgrammingError:
When *sql* contains more than one SQL statement. When :ref:`named placeholders <... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4b4919ab-c227-4901-ab09-277288cb1be3 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,461 | supabase-export-v2 | 7b3ad7577f2d2dbd | .. data:: threadsafety
Integer constant required by the DB-API 2.0, stating the level of thread
safety the :mod:`!sqlite3` module supports. This attribute is set based on
the default `threading mode <https://sqlite.org/threadsafe.html>`_ the
underlying SQLite library is compiled with. The SQLite threading modes are: | trusted_official_docs | CPython Docs | .. data:: threadsafety
Integer constant required by the DB-API 2.0, stating the level of thread
safety the :mod:`!sqlite3` module supports. This attribute is set based on
the default `threading mode <https://sqlite.org/threadsafe.html>`_ the
underlying SQLite library is compiled with. The SQLite threading modes are: | .. data:: threadsafety
Integer constant required by the DB-API 2.0, stating the level of thread
safety the :mod:`!sqlite3` module supports. This attribute is set based on
the default `threading mode <https://sqlite.org/threadsafe.html>`_ the
underlying SQLite library is compiled with. The SQLite threading modes are: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
4c43734e-3d14-4781-b019-eb5f49723237 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,603 | supabase-export-v2 | 483fbeeda0b2e9ec | If ``None`` (the default), SQLite will come up with an entry point name of its own; see the SQLite docs `Loading an Extension`_ for details.
:type entrypoint: str | None | trusted_official_docs | CPython Docs | If ``None`` (the default), SQLite will come up with an entry point name of its own; see the SQLite docs `Loading an Extension`_ for details.
:type entrypoint: str | None | If ``None`` (the default), SQLite will come up with an entry point name of its own; see the SQLite docs `Loading an Extension`_ for details.
:type entrypoint: str | None | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
52c2d3bf-f5dd-4eb3-905b-8c6018a10cdf | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,501 | supabase-export-v2 | c1e82fcab854b50f | rolled back. If :attr:`!autocommit` is ``True`` or :data:`LEGACY_TRANSACTION_CONTROL`, no implicit transaction control is executed. Make sure to :meth:`commit` before closing to avoid losing pending changes.
.. method:: execute(sql, parameters=(), /) | trusted_official_docs | CPython Docs | rolled back. If :attr:`!autocommit` is ``True`` or :data:`LEGACY_TRANSACTION_CONTROL`, no implicit transaction control is executed. Make sure to :meth:`commit` before closing to avoid losing pending changes.
.. method:: execute(sql, parameters=(), /) | rolled back. If :attr:`!autocommit` is ``True`` or :data:`LEGACY_TRANSACTION_CONTROL`, no implicit transaction control is executed. Make sure to :meth:`commit` before closing to avoid losing pending changes.
.. method:: execute(sql, parameters=(), /) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
538331f5-73c8-4ef8-9e13-ff22947e7c73 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,822 | supabase-export-v2 | 018ce3eac6591cae | class of the other exceptions in this module. Use this to catch all errors with one single :keyword:`except` statement. ``Error`` is a subclass of :exc:`Exception`.
If the exception originated from within the SQLite library,
the following two attributes are added to the exception: | trusted_official_docs | CPython Docs | class of the other exceptions in this module. Use this to catch all errors with one single :keyword:`except` statement. ``Error`` is a subclass of :exc:`Exception`.
If the exception originated from within the SQLite library,
the following two attributes are added to the exception: | class of the other exceptions in this module. Use this to catch all errors with one single :keyword:`except` statement. ``Error`` is a subclass of :exc:`Exception`.
If the exception originated from within the SQLite library,
the following two attributes are added to the exception: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
53ad9a6c-8ea6-4538-9648-519b77c3670e | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,549 | supabase-export-v2 | 43fc2cba5f88ef3b | Any clean-up actions should be placed here. """ return self.count
con = sqlite3.connect(":memory:")
cur = con.execute("CREATE TABLE test(x, y)")
values = [
("a", 4),
("b", 5),
("c", 3),
("d", 8),
("e", 1),
]
cur.executemany("INSERT INTO test VALUES(?, ?)", values)
con.create_window_function("sumint", 1, Windo... | trusted_official_docs | CPython Docs | Any clean-up actions should be placed here. """ return self.count
con = sqlite3.connect(":memory:")
cur = con.execute("CREATE TABLE test(x, y)")
values = [
("a", 4),
("b", 5),
("c", 3),
("d", 8),
("e", 1),
]
cur.executemany("INSERT INTO test VALUES(?, ?)", values)
con.create_window_function("sumint", 1, Windo... | Any clean-up actions should be placed here. """ return self.count
con = sqlite3.connect(":memory:")
cur = con.execute("CREATE TABLE test(x, y)")
values = [
("a", 4),
("b", 5),
("c", 3),
("d", 8),
("e", 1),
]
cur.executemany("INSERT INTO test VALUES(?, ?)", values)
con.create_window_function("sumint", 1, Windo... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
55a64e84-886a-4a31-8f32-e80ed8a7d191 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,384 | supabase-export-v2 | a62eb9f67165c176 | .. doctest::
>>> con.close()
>>> new_con = sqlite3.connect("tutorial.db")
>>> new_cur = new_con.cursor()
>>> res = new_cur.execute("SELECT title, year FROM movie ORDER BY score DESC")
>>> title, year = res.fetchone()
>>> print(f'The highest scoring Monty Python movie is {title!r}, released in {year}')
The highest... | trusted_official_docs | CPython Docs | .. doctest::
>>> con.close()
>>> new_con = sqlite3.connect("tutorial.db")
>>> new_cur = new_con.cursor()
>>> res = new_cur.execute("SELECT title, year FROM movie ORDER BY score DESC")
>>> title, year = res.fetchone()
>>> print(f'The highest scoring Monty Python movie is {title!r}, released in {year}')
The highest... | .. doctest::
>>> con.close()
>>> new_con = sqlite3.connect("tutorial.db")
>>> new_cur = new_con.cursor()
>>> res = new_cur.execute("SELECT title, year FROM movie ORDER BY score DESC")
>>> title, year = res.fetchone()
>>> print(f'The highest scoring Monty Python movie is {title!r}, released in {year}')
The highest... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
56930e30-4078-47ee-9261-1106292ffe96 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,580 | supabase-export-v2 | c074664fa23c2c26 | to the :meth:`Cursor.execute` methods. Other sources include the :ref:`transaction management <sqlite3-controlling-transactions>` of the :mod:`!sqlite3` module and the execution of triggers defined in the current database.
Passing ``None`` as *trace_callback* will disable the trace callback. | trusted_official_docs | CPython Docs | to the :meth:`Cursor.execute` methods. Other sources include the :ref:`transaction management <sqlite3-controlling-transactions>` of the :mod:`!sqlite3` module and the execution of triggers defined in the current database.
Passing ``None`` as *trace_callback* will disable the trace callback. | to the :meth:`Cursor.execute` methods. Other sources include the :ref:`transaction management <sqlite3-controlling-transactions>` of the :mod:`!sqlite3` module and the execution of triggers defined in the current database.
Passing ``None`` as *trace_callback* will disable the trace callback. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
57470e3f-0b11-4fb5-9ac3-25baf291a31b | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,381 | supabase-export-v2 | 6f0532aa20d884c2 | and the Holy Grail') (1979, "Monty Python's Life of Brian") (1982, 'Monty Python Live at the Hollywood Bowl') (1983, "Monty Python's The Meaning of Life")
Each row is a two-item :class:`tuple` of ``(year, title)``,
matching the columns selected in the query. | trusted_official_docs | CPython Docs | and the Holy Grail') (1979, "Monty Python's Life of Brian") (1982, 'Monty Python Live at the Hollywood Bowl') (1983, "Monty Python's The Meaning of Life")
Each row is a two-item :class:`tuple` of ``(year, title)``,
matching the columns selected in the query. | and the Holy Grail') (1979, "Monty Python's Life of Brian") (1982, 'Monty Python Live at the Hollywood Bowl') (1983, "Monty Python's The Meaning of Life")
Each row is a two-item :class:`tuple` of ``(year, title)``,
matching the columns selected in the query. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5832db84-9f15-444e-b531-9788bc3962d8 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,746 | supabase-export-v2 | 384c4e0eb07481aa | a pending transaction, an implicit ``COMMIT`` statement is executed first. No other implicit transaction control is performed; any transaction control must be added to *sql_script*.
*sql_script* must be a :class:`string <str>`. | trusted_official_docs | CPython Docs | a pending transaction, an implicit ``COMMIT`` statement is executed first. No other implicit transaction control is performed; any transaction control must be added to *sql_script*.
*sql_script* must be a :class:`string <str>`. | a pending transaction, an implicit ``COMMIT`` statement is executed first. No other implicit transaction control is performed; any transaction control must be added to *sql_script*.
*sql_script* must be a :class:`string <str>`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
58a71b94-c6c1-4351-b675-14ab1bda02c9 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,349 | supabase-export-v2 | 248ed15dac75781c | you will create a database of Monty Python movies using basic :mod:`!sqlite3` functionality. It assumes a fundamental understanding of database concepts, including `cursors`_ and `transactions`_.
First, we need to create a new database and open
a database connection to allow :mod:`!sqlite3` to work with it. Call :func:... | trusted_official_docs | CPython Docs | you will create a database of Monty Python movies using basic :mod:`!sqlite3` functionality. It assumes a fundamental understanding of database concepts, including `cursors`_ and `transactions`_.
First, we need to create a new database and open
a database connection to allow :mod:`!sqlite3` to work with it. Call :func:... | you will create a database of Monty Python movies using basic :mod:`!sqlite3` functionality. It assumes a fundamental understanding of database concepts, including `cursors`_ and `transactions`_.
First, we need to create a new database and open
a database connection to allow :mod:`!sqlite3` to work with it. Call :func:... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5b86a785-c191-45c7-8744-61332b11747b | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,850 | supabase-export-v2 | bed13e8b5414d1bb | +-------------------------------+-------------+ | :class:`int` | ``INTEGER`` | +-------------------------------+-------------+ | :class:`float` | ``REAL`` | +-------------------------------+-------------+ | :class:`str` | ``TEXT`` | +-------------------------------+-------------+ | :class:`bytes` | ``BLOB`` | +--------... | trusted_official_docs | CPython Docs | +-------------------------------+-------------+ | :class:`int` | ``INTEGER`` | +-------------------------------+-------------+ | :class:`float` | ``REAL`` | +-------------------------------+-------------+ | :class:`str` | ``TEXT`` | +-------------------------------+-------------+ | :class:`bytes` | ``BLOB`` | +--------... | +-------------------------------+-------------+ | :class:`int` | ``INTEGER`` | +-------------------------------+-------------+ | :class:`float` | ``REAL`` | +-------------------------------+-------------+ | :class:`str` | ``TEXT`` | +-------------------------------+-------------+ | :class:`bytes` | ``BLOB`` | +--------... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
5c72185a-4fe6-4224-b545-a3683694f02a | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,535 | supabase-export-v2 | 79262d0335467b26 | :param str name: The name of the SQL aggregate window function to create or remove.
:param int num_params:
The number of arguments the SQL aggregate window function can accept. If ``-1``, it may take any number of arguments. | trusted_official_docs | CPython Docs | :param str name: The name of the SQL aggregate window function to create or remove.
:param int num_params:
The number of arguments the SQL aggregate window function can accept. If ``-1``, it may take any number of arguments. | :param str name: The name of the SQL aggregate window function to create or remove.
:param int num_params:
The number of arguments the SQL aggregate window function can accept. If ``-1``, it may take any number of arguments. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
61a86615-6172-45bd-8699-1b165a6afd34 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,587 | supabase-export-v2 | b7e8956f03f28e1f | .. note::
The :mod:`!sqlite3` module is not built with loadable extension support by
default, because some platforms (notably macOS) have SQLite
libraries which are compiled without this feature. To get loadable extension support,
you must pass the :option:`--enable-loadable-sqlite-extensions` option
to :program:`c... | trusted_official_docs | CPython Docs | .. note::
The :mod:`!sqlite3` module is not built with loadable extension support by
default, because some platforms (notably macOS) have SQLite
libraries which are compiled without this feature. To get loadable extension support,
you must pass the :option:`--enable-loadable-sqlite-extensions` option
to :program:`c... | .. note::
The :mod:`!sqlite3` module is not built with loadable extension support by
default, because some platforms (notably macOS) have SQLite
libraries which are compiled without this feature. To get loadable extension support,
you must pass the :option:`--enable-loadable-sqlite-extensions` option
to :program:`c... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
62089d8a-b19a-477c-ab45-fe31ad42eded | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,994 | supabase-export-v2 | 0678f049a757e28b | the above example. In such cases, SQLite returns a single row with columns defined by expressions, e.g. literals, with the given aliases ``expr AS alias``.
You can create a custom :attr:`~Cursor.row_factory`
that returns each row as a :class:`dict`, with column names mapped to values: | trusted_official_docs | CPython Docs | the above example. In such cases, SQLite returns a single row with columns defined by expressions, e.g. literals, with the given aliases ``expr AS alias``.
You can create a custom :attr:`~Cursor.row_factory`
that returns each row as a :class:`dict`, with column names mapped to values: | the above example. In such cases, SQLite returns a single row with columns defined by expressions, e.g. literals, with the given aliases ``expr AS alias``.
You can create a custom :attr:`~Cursor.row_factory`
that returns each row as a :class:`dict`, with column names mapped to values: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
63381b3a-e6ce-43f9-84f9-551f0f0bf79b | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,498 | supabase-export-v2 | 117a9893bfd1b5e7 | .. method:: rollback()
Roll back to the start of any pending transaction. If :attr:`autocommit` is ``True``, or there is no open transaction,
this method does nothing. If :attr:`!autocommit` is ``False``, a new transaction is implicitly
opened if a pending transaction was rolled back by this method. | trusted_official_docs | CPython Docs | .. method:: rollback()
Roll back to the start of any pending transaction. If :attr:`autocommit` is ``True``, or there is no open transaction,
this method does nothing. If :attr:`!autocommit` is ``False``, a new transaction is implicitly
opened if a pending transaction was rolled back by this method. | .. method:: rollback()
Roll back to the start of any pending transaction. If :attr:`autocommit` is ``True``, or there is no open transaction,
this method does nothing. If :attr:`!autocommit` is ``False``, a new transaction is implicitly
opened if a pending transaction was rolled back by this method. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
64144479-105c-4a0f-81d7-ed9fbd0cb706 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,866 | supabase-export-v2 | 16e99af415c4236f | can be invoked as a script, using the interpreter's :option:`-m` switch, in order to provide a simple SQLite shell. The argument signature is as follows::
python -m sqlite3 [-h] [-v] [filename] [sql] | trusted_official_docs | CPython Docs | can be invoked as a script, using the interpreter's :option:`-m` switch, in order to provide a simple SQLite shell. The argument signature is as follows::
python -m sqlite3 [-h] [-v] [filename] [sql] | can be invoked as a script, using the interpreter's :option:`-m` switch, in order to provide a simple SQLite shell. The argument signature is as follows::
python -m sqlite3 [-h] [-v] [filename] [sql] | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
643b49ff-2801-4c66-bdc3-54208c2c4253 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,907 | supabase-export-v2 | 27bd188e05456da0 | How to convert SQLite values to custom Python types ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Writing an adapter lets you convert *from* custom Python types *to* SQLite
values. To be able to convert *from* SQLite values *to* custom Python types,
we use *converters*. | trusted_official_docs | CPython Docs | How to convert SQLite values to custom Python types ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Writing an adapter lets you convert *from* custom Python types *to* SQLite
values. To be able to convert *from* SQLite values *to* custom Python types,
we use *converters*. | How to convert SQLite values to custom Python types ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Writing an adapter lets you convert *from* custom Python types *to* SQLite
values. To be able to convert *from* SQLite values *to* custom Python types,
we use *converters*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
645168e6-0c3e-482d-a308-2002881e7a00 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,440 | supabase-export-v2 | d864dcd2afbb42da | .. data:: PARSE_COLNAMES
Pass this flag value to the *detect_types* parameter of
:func:`connect` to look up a converter function by
using the type name, parsed from the query column name,
as the converter dictionary key. The query column name must be wrapped in double quotes (``"``)
and the type name must be wrappe... | trusted_official_docs | CPython Docs | .. data:: PARSE_COLNAMES
Pass this flag value to the *detect_types* parameter of
:func:`connect` to look up a converter function by
using the type name, parsed from the query column name,
as the converter dictionary key. The query column name must be wrapped in double quotes (``"``)
and the type name must be wrappe... | .. data:: PARSE_COLNAMES
Pass this flag value to the *detect_types* parameter of
:func:`connect` to look up a converter function by
using the type name, parsed from the query column name,
as the converter dictionary key. The query column name must be wrapped in double quotes (``"``)
and the type name must be wrappe... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
65454efb-ab21-410c-8470-4475ee660a95 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,672 | supabase-export-v2 | 69f5a87362b3706e | .. method:: deserialize(data, /, *, name="main")
Deserialize a :meth:`serialized <serialize>` database into a
:class:`Connection`. This method causes the database connection to disconnect from database
*name*, and reopen *name* as an in-memory database based on the
serialization contained in *data*. | trusted_official_docs | CPython Docs | .. method:: deserialize(data, /, *, name="main")
Deserialize a :meth:`serialized <serialize>` database into a
:class:`Connection`. This method causes the database connection to disconnect from database
*name*, and reopen *name* as an in-memory database based on the
serialization contained in *data*. | .. method:: deserialize(data, /, *, name="main")
Deserialize a :meth:`serialized <serialize>` database into a
:class:`Connection`. This method causes the database connection to disconnect from database
*name*, and reopen *name* as an in-memory database based on the
serialization contained in *data*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
669ac314-f515-47b3-808a-5740eb1ffa3f | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,712 | supabase-export-v2 | 0acb3cbfcae54cc9 | SQL statements, and manage the context of a fetch operation. Cursors are created using :meth:`Connection.cursor`, or by using any of the :ref:`connection shortcut methods <sqlite3-connection-shortcuts>`.
Cursor objects are :term:`iterators <iterator>`,
meaning that if you :meth:`~Cursor.execute` a ``SELECT`` query,
y... | trusted_official_docs | CPython Docs | SQL statements, and manage the context of a fetch operation. Cursors are created using :meth:`Connection.cursor`, or by using any of the :ref:`connection shortcut methods <sqlite3-connection-shortcuts>`.
Cursor objects are :term:`iterators <iterator>`,
meaning that if you :meth:`~Cursor.execute` a ``SELECT`` query,
y... | SQL statements, and manage the context of a fetch operation. Cursors are created using :meth:`Connection.cursor`, or by using any of the :ref:`connection shortcut methods <sqlite3-connection-shortcuts>`.
Cursor objects are :term:`iterators <iterator>`,
meaning that if you :meth:`~Cursor.execute` a ``SELECT`` query,
y... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
669afeea-3894-4de9-a77d-9e94c8f6cab3 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,774 | supabase-export-v2 | 81fa17ea26c4fa7a | To remain compatible with the Python DB API, it returns a 7-tuple for each column where the last six items of each tuple are ``None``.
It is set for ``SELECT`` statements without any matching rows as well. | trusted_official_docs | CPython Docs | To remain compatible with the Python DB API, it returns a 7-tuple for each column where the last six items of each tuple are ``None``.
It is set for ``SELECT`` statements without any matching rows as well. | To remain compatible with the Python DB API, it returns a 7-tuple for each column where the last six items of each tuple are ``None``.
It is set for ``SELECT`` statements without any matching rows as well. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
69f36e9a-7b1a-4c14-bc82-3cf4d6d7e4cb | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,909 | supabase-export-v2 | 1816979d6cea86c7 | Let's go back to the :class:`!Point` class. We stored the x and y coordinates separated via semicolons as strings in SQLite.
First, we'll define a converter function that accepts the string as a parameter
and constructs a :class:`!Point` object from it. | trusted_official_docs | CPython Docs | Let's go back to the :class:`!Point` class. We stored the x and y coordinates separated via semicolons as strings in SQLite.
First, we'll define a converter function that accepts the string as a parameter
and constructs a :class:`!Point` object from it. | Let's go back to the :class:`!Point` class. We stored the x and y coordinates separated via semicolons as strings in SQLite.
First, we'll define a converter function that accepts the string as a parameter
and constructs a :class:`!Point` object from it. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6b0093cd-51af-4648-8b7d-1513d7600c10 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,821 | supabase-export-v2 | a0488f84a2774c45 | .. exception:: Error
The base class of the other exceptions in this module. Use this to catch all errors with one single :keyword:`except` statement. ``Error`` is a subclass of :exc:`Exception`. | trusted_official_docs | CPython Docs | .. exception:: Error
The base class of the other exceptions in this module. Use this to catch all errors with one single :keyword:`except` statement. ``Error`` is a subclass of :exc:`Exception`. | .. exception:: Error
The base class of the other exceptions in this module. Use this to catch all errors with one single :keyword:`except` statement. ``Error`` is a subclass of :exc:`Exception`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6b9a08a7-f6e4-4b71-b4eb-34b659c4a47c | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,512 | supabase-export-v2 | e852963bd7b85f40 | The callable must return :ref:`a type natively supported by SQLite <sqlite3-types>`. Set to ``None`` to remove an existing SQL function. :type func: :term:`callback` | None
:param bool deterministic:
If ``True``, the created SQL function is marked as
`deterministic <https://sqlite.org/deterministic.html>`_,
which al... | trusted_official_docs | CPython Docs | The callable must return :ref:`a type natively supported by SQLite <sqlite3-types>`. Set to ``None`` to remove an existing SQL function. :type func: :term:`callback` | None
:param bool deterministic:
If ``True``, the created SQL function is marked as
`deterministic <https://sqlite.org/deterministic.html>`_,
which al... | The callable must return :ref:`a type natively supported by SQLite <sqlite3-types>`. Set to ``None`` to remove an existing SQL function. :type func: :term:`callback` | None
:param bool deterministic:
If ``True``, the created SQL function is marked as
`deterministic <https://sqlite.org/deterministic.html>`_,
which al... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
6e14310a-9644-4812-9bc8-3a388d91f7ca | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,782 | supabase-export-v2 | 99f323de9ee749c0 | .. attribute:: row_factory
Control how a row fetched from this :class:`!Cursor` is represented. If ``None``, a row is represented as a :class:`tuple`. Can be set to the included :class:`sqlite3.Row`;
or a :term:`callable` that accepts two arguments,
a :class:`Cursor` object and the :class:`!tuple` of row values,
and... | trusted_official_docs | CPython Docs | .. attribute:: row_factory
Control how a row fetched from this :class:`!Cursor` is represented. If ``None``, a row is represented as a :class:`tuple`. Can be set to the included :class:`sqlite3.Row`;
or a :term:`callable` that accepts two arguments,
a :class:`Cursor` object and the :class:`!tuple` of row values,
and... | .. attribute:: row_factory
Control how a row fetched from this :class:`!Cursor` is represented. If ``None``, a row is represented as a :class:`tuple`. Can be set to the included :class:`sqlite3.Row`;
or a :term:`callable` that accepts two arguments,
a :class:`Cursor` object and the :class:`!tuple` of row values,
and... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
722660e8-182b-4023-ae70-6bd0e59eecf8 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,566 | supabase-export-v2 | 25e8e4e14b0aab10 | .. method:: set_authorizer(authorizer_callback, /)
Register :term:`callable` *authorizer_callback* to be invoked
for each attempt to access a column of a table in the database. The callback should return one of :const:`SQLITE_OK`,
:const:`SQLITE_DENY`, or :const:`SQLITE_IGNORE`
to signal how access to the column sho... | trusted_official_docs | CPython Docs | .. method:: set_authorizer(authorizer_callback, /)
Register :term:`callable` *authorizer_callback* to be invoked
for each attempt to access a column of a table in the database. The callback should return one of :const:`SQLITE_OK`,
:const:`SQLITE_DENY`, or :const:`SQLITE_IGNORE`
to signal how access to the column sho... | .. method:: set_authorizer(authorizer_callback, /)
Register :term:`callable` *authorizer_callback* to be invoked
for each attempt to access a column of a table in the database. The callback should return one of :const:`SQLITE_OK`,
:const:`SQLITE_DENY`, or :const:`SQLITE_IGNORE`
to signal how access to the column sho... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
72d806c5-9d74-4cc1-b7a8-cdce02156a7b | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,433 | supabase-export-v2 | 4b2fdce1bb80395b | .. data:: PARSE_DECLTYPES
Pass this flag value to the *detect_types* parameter of
:func:`connect` to look up a converter function using
the declared types for each column. The types are declared when the database table is created. :mod:`!sqlite3` will look up a converter function using the first word of the
declared... | trusted_official_docs | CPython Docs | .. data:: PARSE_DECLTYPES
Pass this flag value to the *detect_types* parameter of
:func:`connect` to look up a converter function using
the declared types for each column. The types are declared when the database table is created. :mod:`!sqlite3` will look up a converter function using the first word of the
declared... | .. data:: PARSE_DECLTYPES
Pass this flag value to the *detect_types* parameter of
:func:`connect` to look up a converter function using
the declared types for each column. The types are declared when the database table is created. :mod:`!sqlite3` will look up a converter function using the first word of the
declared... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7474ab1d-1e1f-47d8-a031-f99a94708a0d | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,597 | supabase-export-v2 | 9cd423045c26a308 | INTO recipe (name, ingredients) VALUES('pumpkin pie', 'pumpkin sugar flour butter'); """) for row in con.execute("SELECT rowid, name, ingredients FROM recipe WHERE name MATCH 'pie'"): print(row)
.. method:: load_extension(path, /, *, entrypoint=None) | trusted_official_docs | CPython Docs | INTO recipe (name, ingredients) VALUES('pumpkin pie', 'pumpkin sugar flour butter'); """) for row in con.execute("SELECT rowid, name, ingredients FROM recipe WHERE name MATCH 'pie'"): print(row)
.. method:: load_extension(path, /, *, entrypoint=None) | INTO recipe (name, ingredients) VALUES('pumpkin pie', 'pumpkin sugar flour butter'); """) for row in con.execute("SELECT rowid, name, ingredients FROM recipe WHERE name MATCH 'pie'"): print(row)
.. method:: load_extension(path, /, *, entrypoint=None) | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
752ff9fd-5508-4669-8345-8283dfdaad36 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,673 | supabase-export-v2 | ce1f5c297c4ac347 | This method causes the database connection to disconnect from database *name*, and reopen *name* as an in-memory database based on the serialization contained in *data*.
:param bytes data:
A serialized database. | trusted_official_docs | CPython Docs | This method causes the database connection to disconnect from database *name*, and reopen *name* as an in-memory database based on the serialization contained in *data*.
:param bytes data:
A serialized database. | This method causes the database connection to disconnect from database *name*, and reopen *name* as an in-memory database based on the serialization contained in *data*.
:param bytes data:
A serialized database. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
764b537d-0fe4-4213-b779-be851a262b0f | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,403 | supabase-export-v2 | 27aaea1fe8163cc0 | :param ~sqlite3.Connection factory: A custom subclass of :class:`Connection` to create the connection with, if not the default :class:`Connection` class.
:param int cached_statements:
The number of statements that :mod:`!sqlite3`
should internally cache for this connection, to avoid parsing overhead. By default, 128 ... | trusted_official_docs | CPython Docs | :param ~sqlite3.Connection factory: A custom subclass of :class:`Connection` to create the connection with, if not the default :class:`Connection` class.
:param int cached_statements:
The number of statements that :mod:`!sqlite3`
should internally cache for this connection, to avoid parsing overhead. By default, 128 ... | :param ~sqlite3.Connection factory: A custom subclass of :class:`Connection` to create the connection with, if not the default :class:`Connection` class.
:param int cached_statements:
The number of statements that :mod:`!sqlite3`
should internally cache for this connection, to avoid parsing overhead. By default, 128 ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7655570c-0a48-4387-89ee-e8eada701a3a | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,385 | supabase-export-v2 | c862cfadd00f984d | Python movie is {title!r}, released in {year}') The highest scoring Monty Python movie is 'Monty Python and the Holy Grail', released in 1975 >>> new_con.close()
You've now created an SQLite database using the :mod:`!sqlite3` module,
inserted data and retrieved values from it in multiple ways. | trusted_official_docs | CPython Docs | Python movie is {title!r}, released in {year}') The highest scoring Monty Python movie is 'Monty Python and the Holy Grail', released in 1975 >>> new_con.close()
You've now created an SQLite database using the :mod:`!sqlite3` module,
inserted data and retrieved values from it in multiple ways. | Python movie is {title!r}, released in {year}') The highest scoring Monty Python movie is 'Monty Python and the Holy Grail', released in 1975 >>> new_con.close()
You've now created an SQLite database using the :mod:`!sqlite3` module,
inserted data and retrieved values from it in multiple ways. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
78946b2d-5bb6-4db8-86b2-a86ff983bd04 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,727 | supabase-export-v2 | 30bb4c16593dd6e7 | :raises ProgrammingError: When *sql* contains more than one SQL statement. When :ref:`named placeholders <sqlite3-placeholders>` are used and *parameters* is a sequence instead of a :class:`dict`.
If :attr:`~Connection.autocommit` is
:data:`LEGACY_TRANSACTION_CONTROL`,
:attr:`~Connection.isolation_level` is not ``Non... | trusted_official_docs | CPython Docs | :raises ProgrammingError: When *sql* contains more than one SQL statement. When :ref:`named placeholders <sqlite3-placeholders>` are used and *parameters* is a sequence instead of a :class:`dict`.
If :attr:`~Connection.autocommit` is
:data:`LEGACY_TRANSACTION_CONTROL`,
:attr:`~Connection.isolation_level` is not ``Non... | :raises ProgrammingError: When *sql* contains more than one SQL statement. When :ref:`named placeholders <sqlite3-placeholders>` are used and *parameters* is a sequence instead of a :class:`dict`.
If :attr:`~Connection.autocommit` is
:data:`LEGACY_TRANSACTION_CONTROL`,
:attr:`~Connection.isolation_level` is not ``Non... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
79a98d28-50a8-447e-af20-be0648de51b9 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,537 | supabase-export-v2 | 44d2002f12ebd9b0 | :param aggregate_class: A class that must implement the following methods:
* ``step()``: Add a row to the current window. * ``value()``: Return the current value of the aggregate. * ``inverse()``: Remove a row from the current window. * ``finalize()``: Return the final result of the aggregate as
:ref:`a type natively ... | trusted_official_docs | CPython Docs | :param aggregate_class: A class that must implement the following methods:
* ``step()``: Add a row to the current window. * ``value()``: Return the current value of the aggregate. * ``inverse()``: Remove a row from the current window. * ``finalize()``: Return the final result of the aggregate as
:ref:`a type natively ... | :param aggregate_class: A class that must implement the following methods:
* ``step()``: Add a row to the current window. * ``value()``: Return the current value of the aggregate. * ``inverse()``: Remove a row from the current window. * ``finalize()``: Return the final result of the aggregate as
:ref:`a type natively ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7b5bc6d2-56a0-45ce-9463-4b62df93ee59 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 4,025 | supabase-export-v2 | 6a71c120e1e833a5 | The recommended way of controlling transaction behaviour is through the :attr:`Connection.autocommit` attribute, which should preferably be set using the *autocommit* parameter of :func:`connect`.
It is suggested to set *autocommit* to ``False``,
which implies :pep:`249`-compliant transaction control. This means: | trusted_official_docs | CPython Docs | The recommended way of controlling transaction behaviour is through the :attr:`Connection.autocommit` attribute, which should preferably be set using the *autocommit* parameter of :func:`connect`.
It is suggested to set *autocommit* to ``False``,
which implies :pep:`249`-compliant transaction control. This means: | The recommended way of controlling transaction behaviour is through the :attr:`Connection.autocommit` attribute, which should preferably be set using the *autocommit* parameter of :func:`connect`.
It is suggested to set *autocommit* to ``False``,
which implies :pep:`249`-compliant transaction control. This means: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7ca5e5df-80ad-4fd8-b83a-51d847a73614 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,405 | supabase-export-v2 | 5aa063079e9b83c3 | The scheme part *must* be ``"file:"``, and the path can be relative or absolute. The query string allows passing parameters to SQLite, enabling various :ref:`sqlite3-uri-tricks`.
:param autocommit:
Control :pep:`249` transaction handling behaviour. See :attr:`Connection.autocommit` and
:ref:`sqlite3-transaction-contr... | trusted_official_docs | CPython Docs | The scheme part *must* be ``"file:"``, and the path can be relative or absolute. The query string allows passing parameters to SQLite, enabling various :ref:`sqlite3-uri-tricks`.
:param autocommit:
Control :pep:`249` transaction handling behaviour. See :attr:`Connection.autocommit` and
:ref:`sqlite3-transaction-contr... | The scheme part *must* be ``"file:"``, and the path can be relative or absolute. The query string allows passing parameters to SQLite, enabling various :ref:`sqlite3-uri-tricks`.
:param autocommit:
Control :pep:`249` transaction handling behaviour. See :attr:`Connection.autocommit` and
:ref:`sqlite3-transaction-contr... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7e024fd1-6d3d-4de4-bdc7-f9646c78cc90 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,953 | supabase-export-v2 | 67a6abe041ff41b7 | fill the table. con = sqlite3.connect(":memory:") con.execute("CREATE TABLE lang(name, first_appeared)") data = [ ("C++", 1985), ("Objective-C", 1984), ] con.executemany("INSERT INTO lang(name, first_appeared) VALUES(?, ?)", data)
# Print the table contents
for row in con.execute("SELECT name, first_appeared FROM lang... | trusted_official_docs | CPython Docs | fill the table. con = sqlite3.connect(":memory:") con.execute("CREATE TABLE lang(name, first_appeared)") data = [ ("C++", 1985), ("Objective-C", 1984), ] con.executemany("INSERT INTO lang(name, first_appeared) VALUES(?, ?)", data)
# Print the table contents
for row in con.execute("SELECT name, first_appeared FROM lang... | fill the table. con = sqlite3.connect(":memory:") con.execute("CREATE TABLE lang(name, first_appeared)") data = [ ("C++", 1985), ("Objective-C", 1984), ] con.executemany("INSERT INTO lang(name, first_appeared) VALUES(?, ?)", data)
# Print the table contents
for row in con.execute("SELECT name, first_appeared FROM lang... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7edec457-02ee-4b54-8851-27eca5b41767 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,622 | supabase-export-v2 | 73fd02a694736883 | pages to copy at a time. If equal to or less than ``0``, the entire database is copied in a single step. Defaults to ``-1``.
:param progress:
If set to a :term:`callable`,
it is invoked with three integer arguments for every backup iteration:
the *status* of the last iteration,
the *remaining* number of pages still... | trusted_official_docs | CPython Docs | pages to copy at a time. If equal to or less than ``0``, the entire database is copied in a single step. Defaults to ``-1``.
:param progress:
If set to a :term:`callable`,
it is invoked with three integer arguments for every backup iteration:
the *status* of the last iteration,
the *remaining* number of pages still... | pages to copy at a time. If equal to or less than ``0``, the entire database is copied in a single step. Defaults to ``-1``.
:param progress:
If set to a :term:`callable`,
it is invoked with three integer arguments for every backup iteration:
the *status* of the last iteration,
the *remaining* number of pages still... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
7fadae23-77c3-474f-98ac-c4f57f52a094 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,573 | supabase-export-v2 | 9aea2bacf991b6dc | .. method:: set_progress_handler(progress_handler, /, n)
Register :term:`callable` *progress_handler* to be invoked for every *n*
instructions of the SQLite virtual machine. This is useful if you want to
get called from SQLite during long-running operations, for example to update
a GUI. | trusted_official_docs | CPython Docs | .. method:: set_progress_handler(progress_handler, /, n)
Register :term:`callable` *progress_handler* to be invoked for every *n*
instructions of the SQLite virtual machine. This is useful if you want to
get called from SQLite during long-running operations, for example to update
a GUI. | .. method:: set_progress_handler(progress_handler, /, n)
Register :term:`callable` *progress_handler* to be invoked for every *n*
instructions of the SQLite virtual machine. This is useful if you want to
get called from SQLite during long-running operations, for example to update
a GUI. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
809ae668-d567-4f4a-a4a2-7da140da7a82 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,706 | supabase-export-v2 | d575a055cac7f130 | a text representation of it. The callable is invoked for SQLite values with the ``TEXT`` data type. By default, this attribute is set to :class:`str`.
See :ref:`sqlite3-howto-encoding` for more details. | trusted_official_docs | CPython Docs | a text representation of it. The callable is invoked for SQLite values with the ``TEXT`` data type. By default, this attribute is set to :class:`str`.
See :ref:`sqlite3-howto-encoding` for more details. | a text representation of it. The callable is invoked for SQLite values with the ``TEXT`` data type. By default, this attribute is set to :class:`str`.
See :ref:`sqlite3-howto-encoding` for more details. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8209974f-e137-4852-9b6f-4206a04ac562 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,348 | supabase-export-v2 | 9d10ea55d878c487 | Tutorial --------
In this tutorial, you will create a database of Monty Python movies
using basic :mod:`!sqlite3` functionality. It assumes a fundamental understanding of database concepts,
including `cursors`_ and `transactions`_. | trusted_official_docs | CPython Docs | Tutorial --------
In this tutorial, you will create a database of Monty Python movies
using basic :mod:`!sqlite3` functionality. It assumes a fundamental understanding of database concepts,
including `cursors`_ and `transactions`_. | Tutorial --------
In this tutorial, you will create a database of Monty Python movies
using basic :mod:`!sqlite3` functionality. It assumes a fundamental understanding of database concepts,
including `cursors`_ and `transactions`_. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
83d7c393-9e6e-412d-9144-77e6681f2357 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,377 | supabase-export-v2 | 863dc9f024482435 | ("Monty Python's Life of Brian", 1979, 8.0), ] cur.executemany("INSERT INTO movie VALUES(?, ?, ?)", data) con.commit() # Remember to commit the transaction after executing INSERT.
Notice that ``?`` placeholders are used to bind ``data`` to the query. Always use placeholders instead of :ref:`string formatting <tut-forma... | trusted_official_docs | CPython Docs | ("Monty Python's Life of Brian", 1979, 8.0), ] cur.executemany("INSERT INTO movie VALUES(?, ?, ?)", data) con.commit() # Remember to commit the transaction after executing INSERT.
Notice that ``?`` placeholders are used to bind ``data`` to the query. Always use placeholders instead of :ref:`string formatting <tut-forma... | ("Monty Python's Life of Brian", 1979, 8.0), ] cur.executemany("INSERT INTO movie VALUES(?, ?, ?)", data) con.commit() # Remember to commit the transaction after executing INSERT.
Notice that ``?`` placeholders are used to bind ``data`` to the query. Always use placeholders instead of :ref:`string formatting <tut-forma... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
83fb4f44-0868-4999-a04d-18532f4d1132 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 4,000 | supabase-export-v2 | 3d2976f7c0bd3499 | = sqlite3.connect(":memory:") >>> con.row_factory = dict_factory >>> for row in con.execute("SELECT 1 AS a, 2 AS b"): ... print(row) {'a': 1, 'b': 2} >>> con.close()
The following row factory returns a :term:`named tuple`: | trusted_official_docs | CPython Docs | = sqlite3.connect(":memory:") >>> con.row_factory = dict_factory >>> for row in con.execute("SELECT 1 AS a, 2 AS b"): ... print(row) {'a': 1, 'b': 2} >>> con.close()
The following row factory returns a :term:`named tuple`: | = sqlite3.connect(":memory:") >>> con.row_factory = dict_factory >>> for row in con.execute("SELECT 1 AS a, 2 AS b"): ... print(row) {'a': 1, 'b': 2} >>> con.close()
The following row factory returns a :term:`named tuple`: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
862c8093-39eb-408c-8eca-6486d74837f9 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,463 | supabase-export-v2 | 6641ad0796e76bd9 | connection is used simultaneously in two or more threads. 3. **Serialized**: In serialized mode, SQLite can be safely used by multiple threads with no restriction.
The mappings from SQLite threading modes to DB-API 2.0 threadsafety levels
are as follows: | trusted_official_docs | CPython Docs | connection is used simultaneously in two or more threads. 3. **Serialized**: In serialized mode, SQLite can be safely used by multiple threads with no restriction.
The mappings from SQLite threading modes to DB-API 2.0 threadsafety levels
are as follows: | connection is used simultaneously in two or more threads. 3. **Serialized**: In serialized mode, SQLite can be safely used by multiple threads with no restriction.
The mappings from SQLite threading modes to DB-API 2.0 threadsafety levels
are as follows: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8715ba94-c82d-4f7f-b979-083289b6f448 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,950 | supabase-export-v2 | 52cafb785ced6a77 | How to use connection shortcut methods ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Using the :meth:`~Connection.execute`,
:meth:`~Connection.executemany`, and :meth:`~Connection.executescript`
methods of the :class:`Connection` class, your code can
be written more concisely because you don't have to create the (often
superf... | trusted_official_docs | CPython Docs | How to use connection shortcut methods ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Using the :meth:`~Connection.execute`,
:meth:`~Connection.executemany`, and :meth:`~Connection.executescript`
methods of the :class:`Connection` class, your code can
be written more concisely because you don't have to create the (often
superf... | How to use connection shortcut methods ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Using the :meth:`~Connection.execute`,
:meth:`~Connection.executemany`, and :meth:`~Connection.executescript`
methods of the :class:`Connection` class, your code can
be written more concisely because you don't have to create the (often
superf... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
88a0ee7f-8fa0-48e1-9b68-fe4efd71e0a3 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,462 | supabase-export-v2 | 1e23828913ad1755 | module supports. This attribute is set based on the default `threading mode <https://sqlite.org/threadsafe.html>`_ the underlying SQLite library is compiled with. The SQLite threading modes are:
1. **Single-thread**: In this mode, all mutexes are disabled and SQLite is
unsafe to use in more than a single thread at onc... | trusted_official_docs | CPython Docs | module supports. This attribute is set based on the default `threading mode <https://sqlite.org/threadsafe.html>`_ the underlying SQLite library is compiled with. The SQLite threading modes are:
1. **Single-thread**: In this mode, all mutexes are disabled and SQLite is
unsafe to use in more than a single thread at onc... | module supports. This attribute is set based on the default `threading mode <https://sqlite.org/threadsafe.html>`_ the underlying SQLite library is compiled with. The SQLite threading modes are:
1. **Single-thread**: In this mode, all mutexes are disabled and SQLite is
unsafe to use in more than a single thread at onc... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
88b464ed-88ae-404e-89cd-bcad7e997237 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,967 | supabase-export-v2 | 6fdd36984d9098ae | exception, # the exception is still raised and must be caught try: with con: con.execute("INSERT INTO lang(name) VALUES(?)", ("Python",)) except sqlite3.IntegrityError: print("couldn't add Python twice")
# Connection object used as context manager only commits or rollbacks transactions,
# so the connection object shou... | trusted_official_docs | CPython Docs | exception, # the exception is still raised and must be caught try: with con: con.execute("INSERT INTO lang(name) VALUES(?)", ("Python",)) except sqlite3.IntegrityError: print("couldn't add Python twice")
# Connection object used as context manager only commits or rollbacks transactions,
# so the connection object shou... | exception, # the exception is still raised and must be caught try: with con: con.execute("INSERT INTO lang(name) VALUES(?)", ("Python",)) except sqlite3.IntegrityError: print("couldn't add Python twice")
# Connection object used as context manager only commits or rollbacks transactions,
# so the connection object shou... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8a5e9612-c145-4fc8-b806-1c4979ef2745 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,579 | supabase-export-v2 | b087e1114a0083f7 | Register :term:`callable` *trace_callback* to be invoked for each SQL statement that is actually executed by the SQLite backend.
The only argument passed to the callback is the statement (as
:class:`str`) that is being executed. The return value of the callback is
ignored. Note that the backend does not only run stat... | trusted_official_docs | CPython Docs | Register :term:`callable` *trace_callback* to be invoked for each SQL statement that is actually executed by the SQLite backend.
The only argument passed to the callback is the statement (as
:class:`str`) that is being executed. The return value of the callback is
ignored. Note that the backend does not only run stat... | Register :term:`callable` *trace_callback* to be invoked for each SQL statement that is actually executed by the SQLite backend.
The only argument passed to the callback is the statement (as
:class:`str`) that is being executed. The return value of the callback is
ignored. Note that the backend does not only run stat... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8c87bdaf-adc8-4e69-a094-4617707702ca | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,858 | supabase-export-v2 | 55e76f0a02c6cb46 | The deprecated default adapters and converters consist of:
* An adapter for :class:`datetime.date` objects to :class:`strings <str>` in
`ISO 8601`_ format. * An adapter for :class:`datetime.datetime` objects to strings in
ISO 8601 format. * A converter for :ref:`declared <sqlite3-converters>` "date" types to
:class:... | trusted_official_docs | CPython Docs | The deprecated default adapters and converters consist of:
* An adapter for :class:`datetime.date` objects to :class:`strings <str>` in
`ISO 8601`_ format. * An adapter for :class:`datetime.datetime` objects to strings in
ISO 8601 format. * A converter for :ref:`declared <sqlite3-converters>` "date" types to
:class:... | The deprecated default adapters and converters consist of:
* An adapter for :class:`datetime.date` objects to :class:`strings <str>` in
`ISO 8601`_ format. * An adapter for :class:`datetime.datetime` objects to strings in
ISO 8601 format. * A converter for :ref:`declared <sqlite3-converters>` "date" types to
:class:... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8d3b9754-d4df-4040-add7-9ba0e2301dac | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,877 | supabase-export-v2 | 6ca2372e55f564f6 | and substitute the actual values into the query by providing them as a :class:`tuple` of values to the second argument of the cursor's :meth:`~Cursor.execute` method.
An SQL statement may use one of two kinds of placeholders:
question marks (qmark style) or named placeholders (named style). For the qmark style, *parame... | trusted_official_docs | CPython Docs | and substitute the actual values into the query by providing them as a :class:`tuple` of values to the second argument of the cursor's :meth:`~Cursor.execute` method.
An SQL statement may use one of two kinds of placeholders:
question marks (qmark style) or named placeholders (named style). For the qmark style, *parame... | and substitute the actual values into the query by providing them as a :class:`tuple` of values to the second argument of the cursor's :meth:`~Cursor.execute` method.
An SQL statement may use one of two kinds of placeholders:
question marks (qmark style) or named placeholders (named style). For the qmark style, *parame... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8de488f1-5dae-40d6-aa35-b4ff56301fc2 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,398 | supabase-export-v2 | 83da70a873a178a7 | opened. You can pass ``":memory:"`` to create an `SQLite database existing only in memory <https://sqlite.org/inmemorydb.html>`_, and open a connection to it. :type database: :term:`path-like object`
:param float timeout:
How many seconds the connection should wait before raising
an :exc:`OperationalError` when a tab... | trusted_official_docs | CPython Docs | opened. You can pass ``":memory:"`` to create an `SQLite database existing only in memory <https://sqlite.org/inmemorydb.html>`_, and open a connection to it. :type database: :term:`path-like object`
:param float timeout:
How many seconds the connection should wait before raising
an :exc:`OperationalError` when a tab... | opened. You can pass ``":memory:"`` to create an `SQLite database existing only in memory <https://sqlite.org/inmemorydb.html>`_, and open a connection to it. :type database: :term:`path-like object`
:param float timeout:
How many seconds the connection should wait before raising
an :exc:`OperationalError` when a tab... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8dee9f53-84c7-483e-9a70-5005183f05ec | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,521 | supabase-export-v2 | 115918c92a9f2a61 | :param int n_arg: The number of arguments the SQL aggregate function can accept. If ``-1``, it may take any number of arguments.
:param aggregate_class:
A class must implement the following methods: | trusted_official_docs | CPython Docs | :param int n_arg: The number of arguments the SQL aggregate function can accept. If ``-1``, it may take any number of arguments.
:param aggregate_class:
A class must implement the following methods: | :param int n_arg: The number of arguments the SQL aggregate function can accept. If ``-1``, it may take any number of arguments.
:param aggregate_class:
A class must implement the following methods: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8ed23373-ce4b-450f-b51e-6e9a673233ab | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,666 | supabase-export-v2 | 3b5fc3e33433d18a | .. method:: serialize(*, name="main")
Serialize a database into a :class:`bytes` object. For an
ordinary on-disk database file, the serialization is just a copy of the
disk file. For an in-memory database or a "temp" database, the
serialization is the same sequence of bytes which would be written to
disk if that da... | trusted_official_docs | CPython Docs | .. method:: serialize(*, name="main")
Serialize a database into a :class:`bytes` object. For an
ordinary on-disk database file, the serialization is just a copy of the
disk file. For an in-memory database or a "temp" database, the
serialization is the same sequence of bytes which would be written to
disk if that da... | .. method:: serialize(*, name="main")
Serialize a database into a :class:`bytes` object. For an
ordinary on-disk database file, the serialization is just a copy of the
disk file. For an in-memory database or a "temp" database, the
serialization is the same sequence of bytes which would be written to
disk if that da... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8ef026c1-8c7e-4e9e-85ed-3d770500fd24 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,569 | supabase-export-v2 | ad500ca7ecd5c922 | first argument and the meaning of the second and third argument depending on the first one. All necessary constants are available in the :mod:`!sqlite3` module.
Passing ``None`` as *authorizer_callback* will disable the authorizer. | trusted_official_docs | CPython Docs | first argument and the meaning of the second and third argument depending on the first one. All necessary constants are available in the :mod:`!sqlite3` module.
Passing ``None`` as *authorizer_callback* will disable the authorizer. | first argument and the meaning of the second and third argument depending on the first one. All necessary constants are available in the :mod:`!sqlite3` module.
Passing ``None`` as *authorizer_callback* will disable the authorizer. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8f1fad05-fd96-4db5-9919-ee19177e5fc2 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,767 | supabase-export-v2 | 8738dbd5b4ea1f91 | attribute that controls the number of rows returned by :meth:`fetchmany`. The default value is 1 which means a single row would be fetched per call.
.. versionchanged:: 3.15
Negative values are rejected by raising :exc:`ValueError`. | trusted_official_docs | CPython Docs | attribute that controls the number of rows returned by :meth:`fetchmany`. The default value is 1 which means a single row would be fetched per call.
.. versionchanged:: 3.15
Negative values are rejected by raising :exc:`ValueError`. | attribute that controls the number of rows returned by :meth:`fetchmany`. The default value is 1 which means a single row would be fetched per call.
.. versionchanged:: 3.15
Negative values are rejected by raising :exc:`ValueError`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
8f92ec7f-d3d4-46d0-a332-639d3f93ec55 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,376 | supabase-export-v2 | 173f742622b7b3b3 | .. testcode::
data = [
("Monty Python Live at the Hollywood Bowl", 1982, 7.9),
("Monty Python's The Meaning of Life", 1983, 7.5),
("Monty Python's Life of Brian", 1979, 8.0),
]
cur.executemany("INSERT INTO movie VALUES(?, ?, ?)", data)
con.commit() # Remember to commit the transaction after executing INSERT. | trusted_official_docs | CPython Docs | .. testcode::
data = [
("Monty Python Live at the Hollywood Bowl", 1982, 7.9),
("Monty Python's The Meaning of Life", 1983, 7.5),
("Monty Python's Life of Brian", 1979, 8.0),
]
cur.executemany("INSERT INTO movie VALUES(?, ?, ?)", data)
con.commit() # Remember to commit the transaction after executing INSERT. | .. testcode::
data = [
("Monty Python Live at the Hollywood Bowl", 1982, 7.9),
("Monty Python's The Meaning of Life", 1983, 7.5),
("Monty Python's Life of Brian", 1979, 8.0),
]
cur.executemany("INSERT INTO movie VALUES(?, ?, ?)", data)
con.commit() # Remember to commit the transaction after executing INSERT. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
914f1d63-c078-404f-9257-c1384b113eaf | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,923 | supabase-export-v2 | fa19cbb880b52048 | # Register the adapter and converter sqlite3.register_adapter(Point, adapt_point) sqlite3.register_converter("point", convert_point)
# 1) Parse using declared types
p = Point(4.0, -3.2)
con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_DECLTYPES)
cur = con.execute("CREATE TABLE test(p point)") | trusted_official_docs | CPython Docs | # Register the adapter and converter sqlite3.register_adapter(Point, adapt_point) sqlite3.register_converter("point", convert_point)
# 1) Parse using declared types
p = Point(4.0, -3.2)
con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_DECLTYPES)
cur = con.execute("CREATE TABLE test(p point)") | # Register the adapter and converter sqlite3.register_adapter(Point, adapt_point) sqlite3.register_converter("point", convert_point)
# 1) Parse using declared types
p = Point(4.0, -3.2)
con = sqlite3.connect(":memory:", detect_types=sqlite3.PARSE_DECLTYPES)
cur = con.execute("CREATE TABLE test(p point)") | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
95c8c789-d5eb-4e4f-8251-1c7e47d0e3b4 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 4,028 | supabase-export-v2 | 089fdcae6b2e2be6 | :meth:`Connection.rollback` have no effect. Note that SQLite's autocommit mode is distinct from the :pep:`249`-compliant :attr:`Connection.autocommit` attribute; use :attr:`Connection.in_transaction` to query the low-level SQLite autocommit mode.
Set *autocommit* to :data:`LEGACY_TRANSACTION_CONTROL`
to leave transacti... | trusted_official_docs | CPython Docs | :meth:`Connection.rollback` have no effect. Note that SQLite's autocommit mode is distinct from the :pep:`249`-compliant :attr:`Connection.autocommit` attribute; use :attr:`Connection.in_transaction` to query the low-level SQLite autocommit mode.
Set *autocommit* to :data:`LEGACY_TRANSACTION_CONTROL`
to leave transacti... | :meth:`Connection.rollback` have no effect. Note that SQLite's autocommit mode is distinct from the :pep:`249`-compliant :attr:`Connection.autocommit` attribute; use :attr:`Connection.in_transaction` to query the low-level SQLite autocommit mode.
Set *autocommit* to :data:`LEGACY_TRANSACTION_CONTROL`
to leave transacti... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
96cedd38-08bb-401a-9808-fec061ead372 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,796 | supabase-export-v2 | e5952f7ce26d0347 | .. versionadded:: 3.11
A :class:`Blob` instance is a :term:`file-like object`
that can read and write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. Call :func:`len(blob) <len>` to get the size (number of bytes) of the blob. Use indices and :term:`slices <slice>` for direct access to the blob data. | trusted_official_docs | CPython Docs | .. versionadded:: 3.11
A :class:`Blob` instance is a :term:`file-like object`
that can read and write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. Call :func:`len(blob) <len>` to get the size (number of bytes) of the blob. Use indices and :term:`slices <slice>` for direct access to the blob data. | .. versionadded:: 3.11
A :class:`Blob` instance is a :term:`file-like object`
that can read and write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. Call :func:`len(blob) <len>` to get the size (number of bytes) of the blob. Use indices and :term:`slices <slice>` for direct access to the blob data. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9e21fc34-5b4e-4f26-b8c3-9efb0e013ee1 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,915 | supabase-export-v2 | 7c654bdab6510544 | it should convert a given SQLite value. This is done when connecting to a database, using the *detect_types* parameter of :func:`connect`. There are three options:
* Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`
* Explicit: set *detect_types* to :const:`PARSE_COLNAMES`
* Both: set *detect_types* to
``sqlite... | trusted_official_docs | CPython Docs | it should convert a given SQLite value. This is done when connecting to a database, using the *detect_types* parameter of :func:`connect`. There are three options:
* Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`
* Explicit: set *detect_types* to :const:`PARSE_COLNAMES`
* Both: set *detect_types* to
``sqlite... | it should convert a given SQLite value. This is done when connecting to a database, using the *detect_types* parameter of :func:`connect`. There are three options:
* Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`
* Explicit: set *detect_types* to :const:`PARSE_COLNAMES`
* Both: set *detect_types* to
``sqlite... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9e7ee179-3d60-4dce-a216-3b48f538daef | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,581 | supabase-export-v2 | c3007aa20234b187 | Passing ``None`` as *trace_callback* will disable the trace callback.
.. note::
Exceptions raised in the trace callback are not propagated. As a
development and debugging aid, use
:meth:`~sqlite3.enable_callback_tracebacks` to enable printing
tracebacks from exceptions raised in the trace callback. | trusted_official_docs | CPython Docs | Passing ``None`` as *trace_callback* will disable the trace callback.
.. note::
Exceptions raised in the trace callback are not propagated. As a
development and debugging aid, use
:meth:`~sqlite3.enable_callback_tracebacks` to enable printing
tracebacks from exceptions raised in the trace callback. | Passing ``None`` as *trace_callback* will disable the trace callback.
.. note::
Exceptions raised in the trace callback are not propagated. As a
development and debugging aid, use
:meth:`~sqlite3.enable_callback_tracebacks` to enable printing
tracebacks from exceptions raised in the trace callback. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9edefedb-1563-412d-9dac-e37cd1b02dde | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,874 | supabase-export-v2 | 190256c4bc37f3de | How to use placeholders to bind values in SQL queries ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SQL operations usually need to use values from Python variables. However,
beware of using Python's string operations to assemble queries, as they
are vulnerable to `SQL injection attacks`_. For example, an attack... | trusted_official_docs | CPython Docs | How to use placeholders to bind values in SQL queries ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SQL operations usually need to use values from Python variables. However,
beware of using Python's string operations to assemble queries, as they
are vulnerable to `SQL injection attacks`_. For example, an attack... | How to use placeholders to bind values in SQL queries ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SQL operations usually need to use values from Python variables. However,
beware of using Python's string operations to assemble queries, as they
are vulnerable to `SQL injection attacks`_. For example, an attack... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
9f40d480-abe4-4745-9138-142c4a77d4d4 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,491 | supabase-export-v2 | 09c86c5166b41dcd | :param bool readonly: Set to ``True`` if the blob should be opened without write permissions. Defaults to ``False``.
:param str name:
The name of the database where the blob is located. Defaults to ``"main"``. | trusted_official_docs | CPython Docs | :param bool readonly: Set to ``True`` if the blob should be opened without write permissions. Defaults to ``False``.
:param str name:
The name of the database where the blob is located. Defaults to ``"main"``. | :param bool readonly: Set to ``True`` if the blob should be opened without write permissions. Defaults to ``False``.
:param str name:
The name of the database where the blob is located. Defaults to ``"main"``. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a062e37a-ac4c-41dd-b01d-5f4842402693 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,702 | supabase-export-v2 | 7e7048846d89c16b | .. attribute:: row_factory
The initial :attr:`~Cursor.row_factory`
for :class:`Cursor` objects created from this connection. Assigning to this attribute does not affect the :attr:`!row_factory`
of existing cursors belonging to this connection, only new ones. Is ``None`` by default,
meaning each row is returned as a ... | trusted_official_docs | CPython Docs | .. attribute:: row_factory
The initial :attr:`~Cursor.row_factory`
for :class:`Cursor` objects created from this connection. Assigning to this attribute does not affect the :attr:`!row_factory`
of existing cursors belonging to this connection, only new ones. Is ``None`` by default,
meaning each row is returned as a ... | .. attribute:: row_factory
The initial :attr:`~Cursor.row_factory`
for :class:`Cursor` objects created from this connection. Assigning to this attribute does not affect the :attr:`!row_factory`
of existing cursors belonging to this connection, only new ones. Is ``None`` by default,
meaning each row is returned as a ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a29300a4-d383-4707-9402-66532e5adfff | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,886 | supabase-export-v2 | 04f354d762b96a5e | How to adapt custom Python types to SQLite values ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SQLite supports only a limited set of data types natively. To store custom Python types in SQLite databases, *adapt* them to one of the
:ref:`Python types SQLite natively understands <sqlite3-types>`. | trusted_official_docs | CPython Docs | How to adapt custom Python types to SQLite values ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SQLite supports only a limited set of data types natively. To store custom Python types in SQLite databases, *adapt* them to one of the
:ref:`Python types SQLite natively understands <sqlite3-types>`. | How to adapt custom Python types to SQLite values ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SQLite supports only a limited set of data types natively. To store custom Python types in SQLite databases, *adapt* them to one of the
:ref:`Python types SQLite natively understands <sqlite3-types>`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a2d1b305-c7f4-4595-8192-f861ad7a9f74 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,840 | supabase-export-v2 | 6a964a5f7fcfc0f0 | .. exception:: InternalError
Exception raised when SQLite encounters an internal error. If this is raised, it may indicate that there is a problem with the runtime
SQLite library. ``InternalError`` is a subclass of :exc:`DatabaseError`. | trusted_official_docs | CPython Docs | .. exception:: InternalError
Exception raised when SQLite encounters an internal error. If this is raised, it may indicate that there is a problem with the runtime
SQLite library. ``InternalError`` is a subclass of :exc:`DatabaseError`. | .. exception:: InternalError
Exception raised when SQLite encounters an internal error. If this is raised, it may indicate that there is a problem with the runtime
SQLite library. ``InternalError`` is a subclass of :exc:`DatabaseError`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a64e9fcc-0aec-4bf7-8226-d242dcc6ba8c | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,574 | supabase-export-v2 | 0d4d76d95a9eac89 | of the SQLite virtual machine. This is useful if you want to get called from SQLite during long-running operations, for example to update a GUI.
If you want to clear any previously installed progress handler, call the
method with ``None`` for *progress_handler*. | trusted_official_docs | CPython Docs | of the SQLite virtual machine. This is useful if you want to get called from SQLite during long-running operations, for example to update a GUI.
If you want to clear any previously installed progress handler, call the
method with ``None`` for *progress_handler*. | of the SQLite virtual machine. This is useful if you want to get called from SQLite during long-running operations, for example to update a GUI.
If you want to clear any previously installed progress handler, call the
method with ``None`` for *progress_handler*. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a7099fbc-197b-478b-bb87-46b765e4b3f3 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,559 | supabase-export-v2 | c9f28d23a655ead9 | con = sqlite3.connect(":memory:") con.create_collation("reverse", collate_reverse)
cur = con.execute("CREATE TABLE test(x)")
cur.executemany("INSERT INTO test(x) VALUES(?)", [("a",), ("b",)])
cur.execute("SELECT x FROM test ORDER BY x COLLATE reverse")
for row in cur:
print(row)
con.close() | trusted_official_docs | CPython Docs | con = sqlite3.connect(":memory:") con.create_collation("reverse", collate_reverse)
cur = con.execute("CREATE TABLE test(x)")
cur.executemany("INSERT INTO test(x) VALUES(?)", [("a",), ("b",)])
cur.execute("SELECT x FROM test ORDER BY x COLLATE reverse")
for row in cur:
print(row)
con.close() | con = sqlite3.connect(":memory:") con.create_collation("reverse", collate_reverse)
cur = con.execute("CREATE TABLE test(x)")
cur.executemany("INSERT INTO test(x) VALUES(?)", [("a",), ("b",)])
cur.execute("SELECT x FROM test ORDER BY x COLLATE reverse")
for row in cur:
print(row)
con.close() | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a7bf86c4-004d-4bd6-bf4d-dd0e33b53c4a | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,647 | supabase-export-v2 | 69a5a6fa46934e13 | are silently truncated to the hard upper bound. Regardless of whether or not the limit was changed, the prior value of the limit is returned.
:param int category:
The `SQLite limit category`_ to be set. | trusted_official_docs | CPython Docs | are silently truncated to the hard upper bound. Regardless of whether or not the limit was changed, the prior value of the limit is returned.
:param int category:
The `SQLite limit category`_ to be set. | are silently truncated to the hard upper bound. Regardless of whether or not the limit was changed, the prior value of the limit is returned.
:param int category:
The `SQLite limit category`_ to be set. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
a99fb3fb-42bc-4001-94dd-66c916fe7040 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,359 | supabase-export-v2 | d418a3763373fa0f | .. Ideally, we'd use sqlite_schema instead of sqlite_master below, but SQLite versions older than 3.33.0 do not recognise that variant.
We can verify that the new table has been created by querying
the ``sqlite_master`` table built-in to SQLite,
which should now contain an entry for the ``movie`` table definition
(see ... | trusted_official_docs | CPython Docs | .. Ideally, we'd use sqlite_schema instead of sqlite_master below, but SQLite versions older than 3.33.0 do not recognise that variant.
We can verify that the new table has been created by querying
the ``sqlite_master`` table built-in to SQLite,
which should now contain an entry for the ``movie`` table definition
(see ... | .. Ideally, we'd use sqlite_schema instead of sqlite_master below, but SQLite versions older than 3.33.0 do not recognise that variant.
We can verify that the new table has been created by querying
the ``sqlite_master`` table built-in to SQLite,
which should now contain an entry for the ``movie`` table definition
(see ... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
abb9d160-832b-40c5-a47b-9c9f07b6a113 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,947 | supabase-export-v2 | d53602cfafa3e4af | # Using current time as fromtimestamp() returns local date/time. # Dropping microseconds as adapt_datetime_epoch truncates fractional second part. now = dt.datetime.now().replace(microsecond=0) current_timestamp = int(now.timestamp())
assert adapt_datetime_epoch(now) == current_timestamp
assert convert_timestamp(str(c... | trusted_official_docs | CPython Docs | # Using current time as fromtimestamp() returns local date/time. # Dropping microseconds as adapt_datetime_epoch truncates fractional second part. now = dt.datetime.now().replace(microsecond=0) current_timestamp = int(now.timestamp())
assert adapt_datetime_epoch(now) == current_timestamp
assert convert_timestamp(str(c... | # Using current time as fromtimestamp() returns local date/time. # Dropping microseconds as adapt_datetime_epoch truncates fractional second part. now = dt.datetime.now().replace(microsecond=0) current_timestamp = int(now.timestamp())
assert adapt_datetime_epoch(now) == current_timestamp
assert convert_timestamp(str(c... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
acd7d928-81b6-44d6-91f1-18a497572933 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 4,036 | supabase-export-v2 | 175829532e8cf7cd | the user to perform their own transaction handling using explicit SQL statements. The underlying SQLite library autocommit mode can be queried using the :attr:`~Connection.in_transaction` attribute.
The :meth:`~Cursor.executescript` method implicitly commits
any pending transaction before execution of the given SQL scr... | trusted_official_docs | CPython Docs | the user to perform their own transaction handling using explicit SQL statements. The underlying SQLite library autocommit mode can be queried using the :attr:`~Connection.in_transaction` attribute.
The :meth:`~Cursor.executescript` method implicitly commits
any pending transaction before execution of the given SQL scr... | the user to perform their own transaction handling using explicit SQL statements. The underlying SQLite library autocommit mode can be queried using the :attr:`~Connection.in_transaction` attribute.
The :meth:`~Cursor.executescript` method implicitly commits
any pending transaction before execution of the given SQL scr... | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
acf0cfa4-5840-4e7a-b425-0c85d65ed4f8 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,346 | supabase-export-v2 | 9b598ad10ace3107 | :pep:`249` - Database API Specification 2.0 PEP written by Marc-André Lemburg.
.. We use the following practices for SQL code:
- UPPERCASE for keywords
- snake_case for schema
- single quotes for string literals
- singular for table names
- if needed, use double quotes for table and column names | trusted_official_docs | CPython Docs | :pep:`249` - Database API Specification 2.0 PEP written by Marc-André Lemburg.
.. We use the following practices for SQL code:
- UPPERCASE for keywords
- snake_case for schema
- single quotes for string literals
- singular for table names
- if needed, use double quotes for table and column names | :pep:`249` - Database API Specification 2.0 PEP written by Marc-André Lemburg.
.. We use the following practices for SQL code:
- UPPERCASE for keywords
- snake_case for schema
- single quotes for string literals
- singular for table names
- if needed, use double quotes for table and column names | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
adcdad76-d3d8-469d-b3f2-ed742da81a17 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,830 | supabase-export-v2 | f3a7894c16a2904b | .. exception:: InterfaceError
Exception raised for misuse of the low-level SQLite C API. In other words, if this exception is raised, it probably indicates a bug in the
:mod:`!sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`. | trusted_official_docs | CPython Docs | .. exception:: InterfaceError
Exception raised for misuse of the low-level SQLite C API. In other words, if this exception is raised, it probably indicates a bug in the
:mod:`!sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`. | .. exception:: InterfaceError
Exception raised for misuse of the low-level SQLite C API. In other words, if this exception is raised, it probably indicates a bug in the
:mod:`!sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`. | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
ae7098ee-a5d0-4c6f-9071-5e0f534d341c | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,555 | supabase-export-v2 | fe6691451ef8f2ef | first is ordered higher than the second * ``-1`` if the first is ordered lower than the second * ``0`` if they are ordered equal
The following example shows a reverse sorting collation: | trusted_official_docs | CPython Docs | first is ordered higher than the second * ``-1`` if the first is ordered lower than the second * ``0`` if they are ordered equal
The following example shows a reverse sorting collation: | first is ordered higher than the second * ``-1`` if the first is ordered lower than the second * ``0`` if they are ordered equal
The following example shows a reverse sorting collation: | python, official-docs, cpython, P0 | Local_Trusted_Corpus | |
aec8b20b-e624-4db3-968b-4ff547e6f1c8 | CPython Docs | file://datasets/cpython/Doc/library/sqlite3.rst | unknown | f609689a-7ecb-41dc-8f88-bd517d46a50a | 3,623 | supabase-export-v2 | 57885b470e0d5506 | last iteration, the *remaining* number of pages still to be copied, and the *total* number of pages. Defaults to ``None``. :type progress: :term:`callback` | None
:param str name:
The name of the database to back up. Either ``"main"`` (the default) for the main database,
``"temp"`` for the temporary database,
or the... | trusted_official_docs | CPython Docs | last iteration, the *remaining* number of pages still to be copied, and the *total* number of pages. Defaults to ``None``. :type progress: :term:`callback` | None
:param str name:
The name of the database to back up. Either ``"main"`` (the default) for the main database,
``"temp"`` for the temporary database,
or the... | last iteration, the *remaining* number of pages still to be copied, and the *total* number of pages. Defaults to ``None``. :type progress: :term:`callback` | None
:param str name:
The name of the database to back up. Either ``"main"`` (the default) for the main database,
``"temp"`` for the temporary database,
or the... | python, official-docs, cpython, P0 | Local_Trusted_Corpus |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.