Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
26 changes: 12 additions & 14 deletions Modules/_sqlite/blob.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ read_multiple(pysqlite_Blob *self, Py_ssize_t length, Py_ssize_t offset)


/*[clinic input]
@permit_long_docstring_body
_sqlite3.Blob.read as blob_read

length: int = -1
Expand All @@ -175,14 +174,14 @@ _sqlite3.Blob.read as blob_read

Read data at the current offset position.

If the end of the blob is reached, the data up to end of file will be returned.
When length is not specified, or is negative, Blob.read() will read until the
end of the blob.
If the end of the blob is reached, the data up to end of file will
be returned. When length is not specified, or is negative,
Blob.read() will read until the end of the blob.
[clinic start generated code]*/

static PyObject *
blob_read_impl(pysqlite_Blob *self, int length)
/*[clinic end generated code: output=1fc99b2541360dde input=e5715bcddbcfca5a]*/
/*[clinic end generated code: output=1fc99b2541360dde input=6b745ad37720e556]*/
{
if (!check_blob(self)) {
return NULL;
Expand Down Expand Up @@ -235,21 +234,20 @@ inner_write(pysqlite_Blob *self, const void *buf, Py_ssize_t len,


/*[clinic input]
@permit_long_docstring_body
_sqlite3.Blob.write as blob_write

data: Py_buffer
/

Write data at the current offset.

This function cannot change the blob length. Writing beyond the end of the
blob will result in an exception being raised.
This function cannot change the blob length. Writing beyond the end
of the blob will result in an exception being raised.
[clinic start generated code]*/

static PyObject *
blob_write_impl(pysqlite_Blob *self, Py_buffer *data)
/*[clinic end generated code: output=b34cf22601b570b2 input=203d3458f244814b]*/
/*[clinic end generated code: output=b34cf22601b570b2 input=0d372cb0240a5d49]*/
{
if (!check_blob(self)) {
return NULL;
Expand All @@ -265,7 +263,6 @@ blob_write_impl(pysqlite_Blob *self, Py_buffer *data)


/*[clinic input]
@permit_long_docstring_body
_sqlite3.Blob.seek as blob_seek

offset: int
Expand All @@ -274,14 +271,15 @@ _sqlite3.Blob.seek as blob_seek

Set the current access position to offset.

The origin argument defaults to os.SEEK_SET (absolute blob positioning).
Other values for origin are os.SEEK_CUR (seek relative to the current position)
and os.SEEK_END (seek relative to the blob's end).
The origin argument defaults to os.SEEK_SET (absolute blob
positioning). Other values for origin are os.SEEK_CUR (seek
relative to the current position) and os.SEEK_END (seek relative to
the blob's end).
[clinic start generated code]*/

static PyObject *
blob_seek_impl(pysqlite_Blob *self, int offset, int origin)
/*[clinic end generated code: output=854c5a0e208547a5 input=ee4d88e1dc0b1048]*/
/*[clinic end generated code: output=854c5a0e208547a5 input=84aea1b6b48607dd]*/
{
if (!check_blob(self)) {
return NULL;
Expand Down
19 changes: 10 additions & 9 deletions Modules/_sqlite/clinic/blob.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 22 additions & 19 deletions Modules/_sqlite/clinic/connection.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 28 additions & 28 deletions Modules/_sqlite/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1561,29 +1561,29 @@ pysqlite_connection_set_authorizer_impl(pysqlite_Connection *self,
}

/*[clinic input]
@permit_long_docstring_body
_sqlite3.Connection.set_progress_handler as pysqlite_connection_set_progress_handler

cls: defining_class
progress_handler as callable: object
A callable that takes no arguments.
If the callable returns non-zero, the current query is terminated,
and an exception is raised.
If the callable returns non-zero, the current query is
terminated, and an exception is raised.
/
n: int
The number of SQLite virtual machine instructions that are
executed between invocations of 'progress_handler'.

Set progress handler callback.

If 'progress_handler' is None or 'n' is 0, the progress handler is disabled.
If 'progress_handler' is None or 'n' is 0, the progress handler is
disabled.
[clinic start generated code]*/

static PyObject *
pysqlite_connection_set_progress_handler_impl(pysqlite_Connection *self,
PyTypeObject *cls,
PyObject *callable, int n)
/*[clinic end generated code: output=0739957fd8034a50 input=3ecce6c915922ad4]*/
/*[clinic end generated code: output=0739957fd8034a50 input=fd0d5abb004f370f]*/
{
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
return NULL;
Expand All @@ -1606,6 +1606,7 @@ pysqlite_connection_set_progress_handler_impl(pysqlite_Connection *self,
}

/*[clinic input]
@permit_long_summary
_sqlite3.Connection.set_trace_callback as pysqlite_connection_set_trace_callback

cls: defining_class
Expand All @@ -1619,7 +1620,7 @@ static PyObject *
pysqlite_connection_set_trace_callback_impl(pysqlite_Connection *self,
PyTypeObject *cls,
PyObject *callable)
/*[clinic end generated code: output=d91048c03bfcee05 input=f4f59bf2f87f2026]*/
/*[clinic end generated code: output=d91048c03bfcee05 input=edfd7d890200a9cb]*/
{
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
return NULL;
Expand Down Expand Up @@ -2212,7 +2213,6 @@ pysqlite_connection_create_collation_impl(pysqlite_Connection *self,

#ifdef PY_SQLITE_HAVE_SERIALIZE
/*[clinic input]
@permit_long_docstring_body
_sqlite3.Connection.serialize as serialize

*
Expand All @@ -2221,15 +2221,15 @@ _sqlite3.Connection.serialize as serialize

Serialize a database into a byte string.

For an ordinary on-disk database file, the serialization is just a copy of the
disk file. For an in-memory database or a "temp" database, the serialization is
the same sequence of bytes which would be written to disk if that database
were backed up to disk.
For an ordinary on-disk database file, the serialization is just
a copy of the disk file. For an in-memory database or a "temp"
database, the serialization is the same sequence of bytes which
would be written to disk if that database were backed up to disk.
[clinic start generated code]*/

static PyObject *
serialize_impl(pysqlite_Connection *self, const char *name)
/*[clinic end generated code: output=97342b0e55239dd3 input=963e617cdf75c747]*/
/*[clinic end generated code: output=97342b0e55239dd3 input=7e48654e8e082fa8]*/
{
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
return NULL;
Expand Down Expand Up @@ -2263,7 +2263,6 @@ serialize_impl(pysqlite_Connection *self, const char *name)
}

/*[clinic input]
@permit_long_docstring_body
_sqlite3.Connection.deserialize as deserialize

data: Py_buffer(accept={buffer, str})
Expand All @@ -2275,18 +2274,19 @@ _sqlite3.Connection.deserialize as deserialize

Load a serialized database.

The deserialize interface causes the database connection to disconnect from the
target database, and then reopen it as an in-memory database based on the given
serialized data.
The deserialize interface causes the database connection to
disconnect from the target database, and then reopen it as
an in-memory database based on the given serialized data.

The deserialize interface will fail with SQLITE_BUSY if the database is
currently in a read transaction or is involved in a backup operation.
The deserialize interface will fail with SQLITE_BUSY if the database
is currently in a read transaction or is involved in a backup
operation.
[clinic start generated code]*/

static PyObject *
deserialize_impl(pysqlite_Connection *self, Py_buffer *data,
const char *name)
/*[clinic end generated code: output=e394c798b98bad89 input=037e94599aaa5b5c]*/
/*[clinic end generated code: output=e394c798b98bad89 input=5d20e028d98c0686]*/
{
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
return NULL;
Expand Down Expand Up @@ -2359,13 +2359,14 @@ _sqlite3.Connection.__exit__ as pysqlite_connection_exit

Called when the connection is used as a context manager.

If there was any exception, a rollback takes place; otherwise we commit.
If there was any exception, a rollback takes place; otherwise we
commit.
[clinic start generated code]*/

static PyObject *
pysqlite_connection_exit_impl(pysqlite_Connection *self, PyObject *exc_type,
PyObject *exc_value, PyObject *exc_tb)
/*[clinic end generated code: output=0705200e9321202a input=bd66f1532c9c54a7]*/
/*[clinic end generated code: output=0705200e9321202a input=8fdb0392ee6f3466]*/
{
int commit = 0;
PyObject* result;
Expand Down Expand Up @@ -2400,26 +2401,25 @@ pysqlite_connection_exit_impl(pysqlite_Connection *self, PyObject *exc_type,
}

/*[clinic input]
@permit_long_docstring_body
_sqlite3.Connection.setlimit as setlimit

category: int
The limit category to be set.
limit: int
The new limit. If the new limit is a negative number, the limit is
unchanged.
The new limit. If the new limit is a negative number, the limit
is unchanged.
/

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,
the prior value of the limit is returned.
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.
[clinic start generated code]*/

static PyObject *
setlimit_impl(pysqlite_Connection *self, int category, int limit)
/*[clinic end generated code: output=0d208213f8d68ccd input=bf06e06a21eb37e2]*/
/*[clinic end generated code: output=0d208213f8d68ccd input=5c2e430091206677]*/
{
if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) {
return NULL;
Expand Down
Loading