From 4c10dbab4e677a2aa2e37211d418293a542c3bc4 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Mon, 25 Jul 2022 09:55:01 -0700 Subject: gh-95235: Document undocumented parameters in sqlite3 functions and methods (GH-95236) Co-authored-by: CAM Gerlach (cherry picked from commit ac6a94c669cba8c8384a61b4304c87cc83728335) Co-authored-by: Erlend Egeberg Aasland --- Doc/library/sqlite3.rst | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 28f3b32..3d01eb5 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -573,7 +573,7 @@ Connection Objects .. 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 :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 @@ -599,7 +599,7 @@ Connection Objects .. 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 get called from SQLite during long-running operations, for example to update a GUI. @@ -614,8 +614,8 @@ Connection Objects .. method:: set_trace_callback(trace_callback) - Registers *trace_callback* to be called for each SQL statement that is - actually executed by the SQLite backend. + Register 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 @@ -638,8 +638,10 @@ Connection Objects .. method:: enable_load_extension(enabled, /) - This routine allows/disallows the SQLite engine to load SQLite extensions - from shared libraries. SQLite extensions can define new functions, + Enable the SQLite engine to load SQLite extensions from shared libraries + 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 extension is the fulltext-search extension distributed with SQLite. @@ -656,9 +658,9 @@ Connection Objects .. method:: load_extension(path, /) - This routine loads an SQLite extension from a shared library. You have to - enable extension loading with :meth:`enable_load_extension` before you can - use this routine. + Load an SQLite extension from a shared library located at *path*. + Enable extension loading with :meth:`enable_load_extension` before + calling this method. Loadable extensions are disabled by default. See [#f1]_. @@ -867,8 +869,10 @@ Cursor Objects .. method:: execute(sql, parameters=(), /) - Execute an SQL statement. Values may be bound to the statement using - :ref:`placeholders `. + Execute SQL statement *sql*. + Bind values to the statement using :ref:`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 more than one statement with it, it will raise a :exc:`ProgrammingError`. Use @@ -883,7 +887,7 @@ Cursor Objects .. method:: executemany(sql, seq_of_parameters, /) - Execute a :ref:`parameterized ` SQL command + Execute :ref:`parameterized ` SQL statement *sql* against all parameter sequences or mappings found in the sequence *seq_of_parameters*. It is also possible to use an :term:`iterator` yielding parameters instead of a sequence. @@ -898,7 +902,7 @@ Cursor Objects .. method:: executescript(sql_script, /) - Execute multiple SQL statements at once. + Execute the SQL statements in *sql_script*. If there is a pending transaciton, an implicit ``COMMIT`` statement is executed first. No other implicit transaction control is performed; -- cgit v0.12