Pelokalan
Python ID
id en
Masuk
Proyek
library__sqlite3.po Berkas proyek · python-docs-id-3.14 · Bahasa Indonesia
Modul PO Hanya lihat
Teks sumber — English
Terjemahan — Bahasa Indonesia
Parameters
Parameter
If set to ``True``, *database* is interpreted as a :abbr:`URI (Uniform Resource Identifier)` with a file path and an optional query string. 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`.
All parameters except *database* are now keyword-only.
Create a new :class:`Cursor` object and call :meth:`~Cursor.execute` on it with the given *sql* and *parameters*. Return the new cursor object.
Create a new :class:`Cursor` object and call :meth:`~Cursor.executemany` on it with the given *sql* and *parameters*. Return the new cursor object.
The first three parameters are now positional-only.
All three parameters are now positional-only.
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`.
:exc:`ProgrammingError` is emitted if :ref:`named placeholders <sqlite3-placeholders>` are used and *parameters* is a sequence instead of a :class:`dict`.
For every item in *parameters*, repeatedly execute the :ref:`parameterized <sqlite3-placeholders>` :abbr:`DML (Data Manipulation Language)` SQL statement *sql*.
An :term:`!iterable` of parameters to bind with the placeholders in *sql*. See :ref:`sqlite3-placeholders`.
When *sql* contains more than one SQL statement or is not a DML statement, When :ref:`named placeholders <sqlite3-placeholders>` are used and the items in *parameters* are sequences instead of :class:`dict`\s.
:exc:`ProgrammingError` is emitted if :ref:`named placeholders <sqlite3-placeholders>` are used and the items in *parameters* are sequences instead of :class:`dict`\s.
An SQL statement may use one of two kinds of placeholders: question marks (qmark style) or named placeholders (named style). For the qmark style, *parameters* must be a :term:`sequence` whose length must match the number of placeholders, or a :exc:`ProgrammingError` is raised. For the named style, *parameters* must be an instance of a :class:`dict` (or a subclass), which must contain keys for all named parameters; any extra items are ignored. Here's an example of both styles:
More information about this feature, including a list of parameters, can be found in the `SQLite URI documentation`_.