# If you need to change anything, it should be enough to change setup.cfg.
PACKAGE_NAME = 'pysqlite3'
-VERSION = '0.4.5'
+VERSION = '0.4.6'
# define sqlite sources
sources = [os.path.join('src', source)
# Increase the maximum number of "host parameters" which SQLite will accept
ext.define_macros.append(("SQLITE_MAX_VARIABLE_NUMBER", "250000"))
+ # Increase maximum allowed memory-map size to 1TB
+ ext.define_macros.append(("SQLITE_MAX_MMAP_SIZE", str(2**40)))
+
ext.include_dirs.append(self.amalgamation_root)
ext.sources.append(os.path.join(self.amalgamation_root, "sqlite3.c"))
/* Clean up if user has not called .close() explicitly. */
if (self->db) {
- SQLITE3_CLOSE(self->db);
+ sqlite3_close_v2(self->db);
}
Py_XDECREF(self->isolation_level);
pysqlite_close_all_blobs(self);
if (self->db) {
- rc = SQLITE3_CLOSE(self->db);
+ rc = sqlite3_close_v2(self->db);
if (rc != SQLITE_OK) {
_pysqlite_seterror(self->db, NULL);
if (rc == SQLITE_NOMEM) {
(void)PyErr_NoMemory();
} else {
-#if SQLITE_VERSION_NUMBER > 3007015
PyErr_SetString(pysqlite_OperationalError, sqlite3_errstr(rc));
-#else
- switch (rc) {
- case SQLITE_ERROR:
- /* Description of SQLITE_ERROR in SQLite 3.7.14 and older
- releases. */
- PyErr_SetString(pysqlite_OperationalError,
- "SQL logic error or missing database");
- break;
- case SQLITE_READONLY:
- PyErr_SetString(pysqlite_OperationalError,
- "attempt to write a readonly database");
- break;
- case SQLITE_BUSY:
- PyErr_SetString(pysqlite_OperationalError, "database is locked");
- break;
- case SQLITE_LOCKED:
- PyErr_SetString(pysqlite_OperationalError,
- "database table is locked");
- break;
- default:
- PyErr_Format(pysqlite_OperationalError,
- "unrecognized error code: %d", rc);
- break;
- }
-#endif
}
}
sqlite_int64 _pysqlite_long_as_int64(PyObject * value);
-#if SQLITE_VERSION_NUMBER >= 3007014
-#define SQLITE3_CLOSE sqlite3_close_v2
-#else
-#define SQLITE3_CLOSE sqlite3_close
-#endif
-
#endif