Skip to content

Commit

Permalink
SQLite added constant
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerbinns committed Nov 25, 2024
1 parent 8c1f508 commit f786128
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apsw/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3893,6 +3893,8 @@ SQLITE_IOCAP_SAFE_APPEND: int = 512
"""For `Device Characteristics <https://sqlite.org/c3ref/c_iocap_atomic.html>'__"""
SQLITE_IOCAP_SEQUENTIAL: int = 1024
"""For `Device Characteristics <https://sqlite.org/c3ref/c_iocap_atomic.html>'__"""
SQLITE_IOCAP_SUBPAGE_READ: int = 32768
"""For `Device Characteristics <https://sqlite.org/c3ref/c_iocap_atomic.html>'__"""
SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN: int = 2048
"""For `Device Characteristics <https://sqlite.org/c3ref/c_iocap_atomic.html>'__"""
SQLITE_IOERR: int = 10
Expand Down Expand Up @@ -4315,7 +4317,8 @@ SQLITE_IOCAP_ATOMIC2K SQLITE_IOCAP_ATOMIC32K SQLITE_IOCAP_ATOMIC4K
SQLITE_IOCAP_ATOMIC512 SQLITE_IOCAP_ATOMIC64K SQLITE_IOCAP_ATOMIC8K
SQLITE_IOCAP_BATCH_ATOMIC SQLITE_IOCAP_IMMUTABLE
SQLITE_IOCAP_POWERSAFE_OVERWRITE SQLITE_IOCAP_SAFE_APPEND
SQLITE_IOCAP_SEQUENTIAL SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN"""
SQLITE_IOCAP_SEQUENTIAL SQLITE_IOCAP_SUBPAGE_READ
SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN"""

mapping_extended_result_codes: dict[str | int, int | str]
"""Extended Result Codes mapping names to int and int to names.
Expand Down
4 changes: 3 additions & 1 deletion src/constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ add_apsw_constants(PyObject *module)

/* Device Characteristics */
the_dict = Py_BuildValue(
"{siissiissiissiissiissiissiissiissiissiissiissiissiissiissiis}",
"{siissiissiissiissiissiissiissiissiissiissiissiissiissiissiissiis}",
"SQLITE_IOCAP_ATOMIC", SQLITE_IOCAP_ATOMIC, SQLITE_IOCAP_ATOMIC, "SQLITE_IOCAP_ATOMIC",
"SQLITE_IOCAP_ATOMIC16K", SQLITE_IOCAP_ATOMIC16K, SQLITE_IOCAP_ATOMIC16K, "SQLITE_IOCAP_ATOMIC16K",
"SQLITE_IOCAP_ATOMIC1K", SQLITE_IOCAP_ATOMIC1K, SQLITE_IOCAP_ATOMIC1K, "SQLITE_IOCAP_ATOMIC1K",
Expand All @@ -237,6 +237,7 @@ add_apsw_constants(PyObject *module)
"SQLITE_IOCAP_POWERSAFE_OVERWRITE", SQLITE_IOCAP_POWERSAFE_OVERWRITE, SQLITE_IOCAP_POWERSAFE_OVERWRITE, "SQLITE_IOCAP_POWERSAFE_OVERWRITE",
"SQLITE_IOCAP_SAFE_APPEND", SQLITE_IOCAP_SAFE_APPEND, SQLITE_IOCAP_SAFE_APPEND, "SQLITE_IOCAP_SAFE_APPEND",
"SQLITE_IOCAP_SEQUENTIAL", SQLITE_IOCAP_SEQUENTIAL, SQLITE_IOCAP_SEQUENTIAL, "SQLITE_IOCAP_SEQUENTIAL",
"SQLITE_IOCAP_SUBPAGE_READ", SQLITE_IOCAP_SUBPAGE_READ, SQLITE_IOCAP_SUBPAGE_READ, "SQLITE_IOCAP_SUBPAGE_READ",
"SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN", SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN, SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN, "SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN");
if (!the_dict)
{
Expand Down Expand Up @@ -1046,6 +1047,7 @@ add_apsw_constants(PyObject *module)
|| PyModule_AddIntConstant(module, "SQLITE_IOCAP_POWERSAFE_OVERWRITE", SQLITE_IOCAP_POWERSAFE_OVERWRITE)
|| PyModule_AddIntConstant(module, "SQLITE_IOCAP_SAFE_APPEND", SQLITE_IOCAP_SAFE_APPEND)
|| PyModule_AddIntConstant(module, "SQLITE_IOCAP_SEQUENTIAL", SQLITE_IOCAP_SEQUENTIAL)
|| PyModule_AddIntConstant(module, "SQLITE_IOCAP_SUBPAGE_READ", SQLITE_IOCAP_SUBPAGE_READ)
|| PyModule_AddIntConstant(module, "SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN", SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN)
|| PyModule_AddIntConstant(module, "SQLITE_IOERR", SQLITE_IOERR)
|| PyModule_AddIntConstant(module, "SQLITE_IOERR_ACCESS", SQLITE_IOERR_ACCESS)
Expand Down

0 comments on commit f786128

Please sign in to comment.