Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add docs
  • Loading branch information
Erlend E. Aasland committed Sep 19, 2021
commit 6fd1c74f8abaa2657198f15c391a74934ea3c05b
34 changes: 34 additions & 0 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,40 @@ Connection Objects
.. versionadded:: 3.7


.. method:: getlimit(limit, /)

Get a connection run-time limit. *limit* is the limit category to be
queried.

Example, query the maximum length of an SQL statement::

import sqlite3
con = sqlite3.connect(":memory:")
lim = con.getlimit(sqlite3.SQLITE_LIMIT_SQL_LENGTH)
print(f"SQLITE_LIMIT_SQL_LENGTH={lim}")

.. versionadded:: 3.11


.. method:: setlimit(limit, value, /)

Set a connection run-time limit. *limit* is the limit category to be set.
*value* is the new limit. If the new limit is a negative number, the
limit is unchanged.

Attempts to increase a limit above its hard upper bound 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.

Example, limit the number of attached databases to 1::

import sqlite3
con = sqlite3.connect(":memory:")
con.setlimit(sqlite3.SQLITE_LIMIT_ATTACHED, 1)

.. versionadded:: 3.11


.. _sqlite3-cursor-objects:

Cursor Objects
Expand Down