Visitar URL original
bpo-45243: Add support for setting/getting `sqlite3` connection limits by erlend-aasland · Pull Request #28463 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
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
Drop 'Non-standard' from docstring
  • Loading branch information
Erlend E. Aasland
Erlend E. Aasland committed Oct 8, 2021
commit 1c36d9580d87a06e876dd27a21589cdba6fd952e
6 changes: 3 additions & 3 deletions Modules/_sqlite/clinic/connection.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ PyDoc_STRVAR(setlimit__doc__,
"setlimit($self, category, limit, /)\n"
"--\n"
"\n"
"Set connection run-time limits. Non-standard.\n"
"Set connection run-time limits.\n"
"\n"
" category\n"
" The limit category to be set.\n"
Expand Down Expand Up @@ -862,7 +862,7 @@ PyDoc_STRVAR(getlimit__doc__,
"getlimit($self, category, /)\n"
"--\n"
"\n"
"Get connection run-time limits. Non-standard.\n"
"Get connection run-time limits.\n"
"\n"
" category\n"
" The limit category to be queried.");
Expand Down Expand Up @@ -896,4 +896,4 @@ getlimit(pysqlite_Connection *self, PyObject *arg)
#ifndef PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF
#define PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF
#endif /* !defined(PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF) */
/*[clinic end generated code: output=ef576e9b40005272 input=a9049054013a1b77]*/
/*[clinic end generated code: output=4d0ff26c99e22885 input=a9049054013a1b77]*/
8 changes: 4 additions & 4 deletions Modules/_sqlite/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1876,7 +1876,7 @@ _sqlite3.Connection.setlimit as setlimit
unchanged.
/

Set connection run-time limits. Non-standard.
Set connection run-time limits.

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,
Expand All @@ -1885,7 +1885,7 @@ the prior value of the limit is returned.

static PyObject *
setlimit_impl(pysqlite_Connection *self, int category, int limit)
/*[clinic end generated code: output=0d208213f8d68ccd input=9d3a8e83f4cc32d7]*/
/*[clinic end generated code: output=0d208213f8d68ccd input=9bd469537e195635]*/
{
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
return NULL;
Expand All @@ -1906,12 +1906,12 @@ _sqlite3.Connection.getlimit as getlimit
The limit category to be queried.
/

Get connection run-time limits. Non-standard.
Get connection run-time limits.
[clinic start generated code]*/

static PyObject *
getlimit_impl(pysqlite_Connection *self, int category)
/*[clinic end generated code: output=7c3f5d11f24cecb1 input=788e5fb4e2d2b618]*/
/*[clinic end generated code: output=7c3f5d11f24cecb1 input=61e0849fb4fb058f]*/
{
return setlimit_impl(self, category, -1);
}
Expand Down