-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
bpo-27645: Supporting native backup facility of SQLite #4238
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
0c9a4e5
624849a
b17e572
3a64654
8220ed6
f7c6fc5
df607df
169369b
7ee5341
f88cd12
7ee018c
21bfc82
9574b91
09407c8
f99e65e
aaa1508
13de3a1
9b2f47a
ce55873
5a08168
960303f
4bd0b3e
7dc53f0
a333639
4ea5ca4
48fd04b
3256d52
a04a86e
a4334a6
69d8996
ac5c64b
09671e4
b5260e0
37f316f
b7fcf9e
6566166
e6f8950
5b06a74
5c20723
2155feb
d21c9cb
8e096c2
a2f15bc
66df8b3
814ef4e
8fe5c30
acc2f37
32285b1
7943561
824d5f8
6fd854a
57f49c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Suggested by Aviv Palivoda.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1448,14 +1448,15 @@ pysqlite_connection_backup(pysqlite_Connection* self, PyObject* args, PyObject* | |
char* filename; | ||
int pages = -1; | ||
PyObject* progress = Py_None; | ||
char* name = "main"; | ||
PyObject* retval = NULL; | ||
int rc; | ||
sqlite3 *bckconn; | ||
sqlite3_backup *bckhandle; | ||
static char *keywords[] = {"filename", "pages", "progress", NULL}; | ||
static char *keywords[] = {"filename", "pages", "progress", "name", NULL}; | ||
|
||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|$iO:backup", keywords, | ||
&filename, &pages, &progress)) { | ||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|$iOs:backup", keywords, | ||
&filename, &pages, &progress, &name)) { | ||
goto finally; | ||
} | ||
|
||
|
@@ -1477,7 +1478,7 @@ pysqlite_connection_backup(pysqlite_Connection* self, PyObject* args, PyObject* | |
} | ||
|
||
Py_BEGIN_ALLOW_THREADS | ||
bckhandle = sqlite3_backup_init(bckconn, "main", self->db, "main"); | ||
bckhandle = sqlite3_backup_init(bckconn, "main", self->db, name); | ||
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. Is it worth to make the destination table name configurable? 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. The second parameter, |
||
Py_END_ALLOW_THREADS | ||
|
||
if (bckhandle) { | ||
|
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.
PEP 7, the
*
come before the var name, not after the type. It'sPyObject *progress
. Same forchar *name
.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.
I've used the same style as the whole unit, do you think I should follow PEP7 in only new function?
I personally prefer that style, but seemed better to follow the code around... the same reasoning I had with the backup.py (but that's completely new...)
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.
Are you sure? :)
I guess muscle memory is hard to beat...
Your remark is valid. I don't care that much about PEP 7, as long as you stick to one one style. It's really up to you, either obey PEP 7 for new code or stick to the existing style.