Repository navigation
bpo-27645: Supporting native backup facility of SQLite #377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
d93391d
7b1277a
1258d47
d8ea457
35fa0ad
c1af5a0
c07d982
cdc7eda
6d3eb69
6fab17f
6449f3d
f84d375
e748942
426dad4
895726b
77dfa39
71726ba
c4fbc20
ff1609b
d688f20
4ed6c31
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1478,7 +1478,7 @@ pysqlite_connection_iterdump(pysqlite_Connection* self, PyObject* args) | |
| } | ||
|
|
||
| static PyObject * | ||
| pysqlite_connection_backup(pysqlite_Connection* self, PyObject* args) | ||
| pysqlite_connection_backup(pysqlite_Connection* self, PyObject* args, PyObject* kwds) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I read SQLite release notes correctly,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, is it better to omit the whole function or rather raise an
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's omit the whole function. This is what we do for other version specific features in the stdlib. Please also update the documentation to note that this feature is available from SQLite 3.6.11.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, done. Thank you! |
||
| { | ||
| char* filename; | ||
| int pages = -1; | ||
|
|
@@ -1487,9 +1487,10 @@ pysqlite_connection_backup(pysqlite_Connection* self, PyObject* args) | |
| int rc; | ||
| sqlite3 *bckconn; | ||
| sqlite3_backup *bckhandle; | ||
| static char *keywords[] = {"filename", "pages", "progress", NULL}; | ||
|
|
||
| if (!PyArg_ParseTuple(args, "s|iO:backup(filename, pages, progress)", | ||
| &filename, &pages, &progress)) { | ||
| if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|$iO:backup", keywords, | ||
| &filename, &pages, &progress)) { | ||
| goto finally; | ||
| } | ||
|
|
||
|
|
@@ -1734,8 +1735,8 @@ static PyMethodDef connection_methods[] = { | |
| PyDoc_STR("Abort any pending database operation. Non-standard.")}, | ||
| {"iterdump", (PyCFunction)pysqlite_connection_iterdump, METH_NOARGS, | ||
| PyDoc_STR("Returns iterator to the dump of the database in an SQL text format. Non-standard.")}, | ||
| {"backup", (PyCFunction)pysqlite_connection_backup, METH_VARARGS, | ||
| PyDoc_STR("Execute a backup of the database. Non-standard.")}, | ||
| {"backup", (PyCFunction)pysqlite_connection_backup, METH_VARARGS | METH_KEYWORDS, | ||
| PyDoc_STR("Makes a backup of the database. Non-standard.")}, | ||
| {"__enter__", (PyCFunction)pysqlite_connection_enter, METH_NOARGS, | ||
| PyDoc_STR("For context manager. Non-standard.")}, | ||
| {"__exit__", (PyCFunction)pysqlite_connection_exit, METH_VARARGS, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add a link to SQLite docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.