Skip to content
Snippets Groups Projects
Unverified Commit ac6a94c6 authored by Erlend Egeberg Aasland's avatar Erlend Egeberg Aasland Committed by GitHub
Browse files

gh-95235: Document undocumented parameters in sqlite3 functions and methods (#95236)

parent 10b12dd9
No related branches found
No related tags found
No related merge requests found
...@@ -583,7 +583,7 @@ Connection Objects ...@@ -583,7 +583,7 @@ Connection Objects
.. method:: set_authorizer(authorizer_callback) .. method:: set_authorizer(authorizer_callback)
This routine registers a callback. The callback is invoked for each attempt to Register callable *authorizer_callback* to be invoked for each attempt to
access a column of a table in the database. The callback should return access a column of a table in the database. The callback should return
:const:`SQLITE_OK` if access is allowed, :const:`SQLITE_DENY` if the entire SQL :const:`SQLITE_OK` if access is allowed, :const:`SQLITE_DENY` if the entire SQL
statement should be aborted with an error and :const:`SQLITE_IGNORE` if the statement should be aborted with an error and :const:`SQLITE_IGNORE` if the
...@@ -609,7 +609,7 @@ Connection Objects ...@@ -609,7 +609,7 @@ Connection Objects
.. method:: set_progress_handler(progress_handler, n) .. method:: set_progress_handler(progress_handler, n)
This routine registers a callback. The callback is invoked for every *n* Register callable *progress_handler* to be invoked for every *n*
instructions of the SQLite virtual machine. This is useful if you want to 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 get called from SQLite during long-running operations, for example to update
a GUI. a GUI.
...@@ -624,8 +624,8 @@ Connection Objects ...@@ -624,8 +624,8 @@ Connection Objects
.. method:: set_trace_callback(trace_callback) .. method:: set_trace_callback(trace_callback)
Registers *trace_callback* to be called for each SQL statement that is Register callable *trace_callback* to be invoked for each SQL statement
actually executed by the SQLite backend. that is actually executed by the SQLite backend.
The only argument passed to the callback is the statement (as The only argument passed to the callback is the statement (as
:class:`str`) that is being executed. The return value of the callback is :class:`str`) that is being executed. The return value of the callback is
...@@ -648,8 +648,10 @@ Connection Objects ...@@ -648,8 +648,10 @@ Connection Objects
.. method:: enable_load_extension(enabled, /) .. method:: enable_load_extension(enabled, /)
This routine allows/disallows the SQLite engine to load SQLite extensions Enable the SQLite engine to load SQLite extensions from shared libraries
from shared libraries. SQLite extensions can define new functions, if *enabled* is :const:`True`;
else, disallow loading SQLite extensions.
SQLite extensions can define new functions,
aggregates or whole new virtual table implementations. One well-known aggregates or whole new virtual table implementations. One well-known
extension is the fulltext-search extension distributed with SQLite. extension is the fulltext-search extension distributed with SQLite.
...@@ -666,9 +668,9 @@ Connection Objects ...@@ -666,9 +668,9 @@ Connection Objects
.. method:: load_extension(path, /) .. method:: load_extension(path, /)
This routine loads an SQLite extension from a shared library. You have to Load an SQLite extension from a shared library located at *path*.
enable extension loading with :meth:`enable_load_extension` before you can Enable extension loading with :meth:`enable_load_extension` before
use this routine. calling this method.
Loadable extensions are disabled by default. See [#f1]_. Loadable extensions are disabled by default. See [#f1]_.
...@@ -877,8 +879,10 @@ Cursor Objects ...@@ -877,8 +879,10 @@ Cursor Objects
.. method:: execute(sql, parameters=(), /) .. method:: execute(sql, parameters=(), /)
Execute an SQL statement. Values may be bound to the statement using Execute SQL statement *sql*.
:ref:`placeholders <sqlite3-placeholders>`. Bind values to the statement using :ref:`placeholders
<sqlite3-placeholders>` that map to the :term:`sequence` or :class:`dict`
*parameters*.
:meth:`execute` will only execute a single SQL statement. If you try to execute :meth:`execute` will only execute a single SQL statement. If you try to execute
more than one statement with it, it will raise a :exc:`ProgrammingError`. Use more than one statement with it, it will raise a :exc:`ProgrammingError`. Use
...@@ -893,7 +897,7 @@ Cursor Objects ...@@ -893,7 +897,7 @@ Cursor Objects
.. method:: executemany(sql, seq_of_parameters, /) .. method:: executemany(sql, seq_of_parameters, /)
Execute a :ref:`parameterized <sqlite3-placeholders>` SQL command Execute :ref:`parameterized <sqlite3-placeholders>` SQL statement *sql*
against all parameter sequences or mappings found in the sequence against all parameter sequences or mappings found in the sequence
*seq_of_parameters*. It is also possible to use an *seq_of_parameters*. It is also possible to use an
:term:`iterator` yielding parameters instead of a sequence. :term:`iterator` yielding parameters instead of a sequence.
...@@ -908,7 +912,7 @@ Cursor Objects ...@@ -908,7 +912,7 @@ Cursor Objects
.. method:: executescript(sql_script, /) .. method:: executescript(sql_script, /)
Execute multiple SQL statements at once. Execute the SQL statements in *sql_script*.
If there is a pending transaciton, If there is a pending transaciton,
an implicit ``COMMIT`` statement is executed first. an implicit ``COMMIT`` statement is executed first.
No other implicit transaction control is performed; No other implicit transaction control is performed;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment