• Home
  • Raw
  • Download

Lines Matching refs:sqlite3

1 :mod:`sqlite3` --- DB-API 2.0 interface for SQLite databases
4 .. module:: sqlite3
9 **Source code:** :source:`Lib/sqlite3/`
20 The sqlite3 module was written by Gerhard Häring. It provides a SQL interface
28 import sqlite3
29 con = sqlite3.connect('example.db')
56 import sqlite3
57 con = sqlite3.connect('example.db')
100 .. literalinclude:: ../includes/sqlite3/execute_1.py
130 the :mod:`sqlite3` module. Required by the DB-API. Hard-coded to
135 The :mod:`sqlite3` module supports both ``qmark`` and ``numeric`` DB-API
165 the :mod:`sqlite3` module supports. Currently hard-coded to ``1``, meaning
170 import sqlite3
171 con = sqlite3.connect(":memory:")
187 Setting it makes the :mod:`sqlite3` module parse the declared type for each
246 By default, the :mod:`sqlite3` module uses its :class:`Connection` class for the
251 Consult the section :ref:`sqlite3-types` of this manual for details.
253 The :mod:`sqlite3` module internally uses a statement cache to avoid SQL parsing
262 db = sqlite3.connect('file:path/to/database?mode=ro', uri=True)
267 .. audit-event:: sqlite3.connect database sqlite3.connect
268 .. audit-event:: sqlite3.connect/handle connection_handle sqlite3.connect
277 Added the ``sqlite3.connect/handle`` auditing event.
307 .. literalinclude:: ../includes/sqlite3/complete_statement.py
332 :ref:`sqlite3-controlling-transactions` for a more detailed explanation.
406 .. literalinclude:: ../includes/sqlite3/md5func.py
423 .. literalinclude:: ../includes/sqlite3/mysumaggr.py
439 .. literalinclude:: ../includes/sqlite3/collation_reverse.py
460 :mod:`sqlite3` module.
471 one. All necessary constants are available in the :mod:`sqlite3` module.
498 :ref:`transaction management <sqlite3-controlling-transactions>` of the
499 sqlite3 module and the execution of triggers defined in the current
507 :meth:`~sqlite3.enable_callback_tracebacks` to enable printing
522 … .. audit-event:: sqlite3.enable_load_extension connection,enabled sqlite3.enable_load_extension
527 Added the ``sqlite3.enable_load_extension`` auditing event.
529 .. literalinclude:: ../includes/sqlite3/load_extension.py
539 .. audit-event:: sqlite3.load_extension connection,path sqlite3.load_extension
544 Added the ``sqlite3.load_extension`` auditing event.
555 .. literalinclude:: ../includes/sqlite3/row_factory.py
559 highly-optimized :class:`sqlite3.Row` type. :class:`Row` provides both
571 :mod:`sqlite3` module will return :class:`str` objects for ``TEXT``.
579 .. literalinclude:: ../includes/sqlite3/text_factory.py
592 the same capabilities as the :kbd:`.dump` command in the :program:`sqlite3`
598 import sqlite3
600 con = sqlite3.connect('existing_db.db')
635 import sqlite3
640 con = sqlite3.connect('existing_db.db')
641 bck = sqlite3.connect('backup.db')
649 import sqlite3
651 source = sqlite3.connect('existing_db.db')
652 dest = sqlite3.connect(':memory:')
673 :ref:`placeholders <sqlite3-placeholders>`.
683 Executes a :ref:`parameterized <sqlite3-placeholders>` SQL command
685 *seq_of_parameters*. The :mod:`sqlite3` module also allows using an
688 .. literalinclude:: ../includes/sqlite3/executemany_1.py
692 .. literalinclude:: ../includes/sqlite3/executemany_2.py
706 .. literalinclude:: ../includes/sqlite3/executescript.py
746 Required by the DB-API. Is a no-op in :mod:`sqlite3`.
750 Required by the DB-API. Is a no-op in :mod:`sqlite3`.
754 Although the :class:`Cursor` class of the :mod:`sqlite3` module implements this
802 >>> con = sqlite3.connect(":memory:")
834 con = sqlite3.connect(":memory:")
846 >>> con.row_factory = sqlite3.Row
849 <sqlite3.Cursor object at 0x7f4e7dd8fa80>
852 <class 'sqlite3.Row'>
963 The type system of the :mod:`sqlite3` module is extensible in two ways: you can
965 you can let the :mod:`sqlite3` module convert SQLite types to different Python
974 sqlite3 module's supported types for SQLite: one of NoneType, int, float,
977 There are two ways to enable the :mod:`sqlite3` module to adapt a custom Python
997 .. literalinclude:: ../includes/sqlite3/adapter_point_1.py
1006 .. literalinclude:: ../includes/sqlite3/adapter_point_2.py
1008 The :mod:`sqlite3` module has two default adapters for Python's built-in
1013 .. literalinclude:: ../includes/sqlite3/adapter_datetime.py
1041 Now you need to make the :mod:`sqlite3` module know that what you select from
1048 Both ways are described in section :ref:`sqlite3-module-contents`, in the entries
1053 .. literalinclude:: ../includes/sqlite3/converter_point.py
1072 .. literalinclude:: ../includes/sqlite3/pysqlite_datetime.py
1090 The underlying ``sqlite3`` library operates in ``autocommit`` mode by default,
1091 but the Python :mod:`sqlite3` module by default does not.
1098 The Python :mod:`sqlite3` module by default issues a ``BEGIN`` statement
1102 You can control which kind of ``BEGIN`` statements :mod:`sqlite3` implicitly
1109 You can disable the :mod:`sqlite3` module's implicit transaction management by
1111 ``sqlite3`` library operating in ``autocommit`` mode. You can then completely
1119 :mod:`sqlite3` used to implicitly commit an open transaction before DDL
1123 Using :mod:`sqlite3` efficiently
1138 .. literalinclude:: ../includes/sqlite3/shortcut_methods.py
1144 One useful feature of the :mod:`sqlite3` module is the built-in
1145 :class:`sqlite3.Row` class designed to be used as a row factory.
1150 .. literalinclude:: ../includes/sqlite3/rowclass.py
1161 .. literalinclude:: ../includes/sqlite3/ctx_manager.py
1166 .. [#f1] The sqlite3 module is not built with loadable extension support by