summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite
Commit message (Collapse)AuthorAgeFilesLines
* bpo-45041: Simplify `sqlite3.Cursor.executescript()` (GH-28020)Erlend Egeberg Aasland2021-09-191-42/+25
|
* bpo-45040: Simplify sqlite3 transaction control functions (GH-28019)Erlend Egeberg Aasland2021-09-192-63/+28
|
* bpo-45126: Fix ref. leak in `sqlite3.Connection.__init__` (GH-28231)Erlend Egeberg Aasland2021-09-122-13/+49
|
* bpo-43413: Fix handling keyword arguments in subclasses of some buitin ↵Serhiy Storchaka2021-09-122-4/+6
| | | | | | | | classes (GH-26456) * Constructors of subclasses of some buitin classes (e.g. tuple, list, frozenset) no longer accept arbitrary keyword arguments. * Subclass of set can now define a __new__() method with additional keyword parameters without overriding also __init__().
* bpo-42064: Pass module state to trace, progress, and authorizer callbacks ↵Erlend Egeberg Aasland2021-09-072-73/+111
| | | | | | | | (GH-27940) - add print-or-clear traceback helper - add helpers to clear and visit saved contexts - modify callbacks to use the new callback_context struct
* bpo-44991: Normalise `sqlite3` callback naming (GH-28088)Erlend Egeberg Aasland2021-09-072-52/+59
| | | | | | | | - all callbacks are now named xxx_callback - normalise callable naming in set_*() functions - normalise context argument naming in callbacks The sqlite code is being "touched" in bpo-42064 (and related issues); this style change makes it easier to work with and review.
* Remove unused macros from Modules/_sqlite/microprotocols.h (GH-28171)Erlend Egeberg Aasland2021-09-051-6/+0
|
* bpo-42064: Offset arguments for PyObject_Vectorcall in the _sqlite module ↵Petr Viktorin2021-08-312-10/+14
| | | | | | | (GH-27931) This allows e.g. methods to be called efficiently by providing space for a "self" argument; see PY_VECTORCALL_ARGUMENTS_OFFSET docs.
* bpo-44991: Make GIL handling more explicit in `sqlite3` callbacks (GH-27934)Erlend Egeberg Aasland2021-08-311-35/+27
| | | | | | | | - acquire the GIL at the very start[1] - release the GIL at the very end [1] The trace callback performs a sanity check before acquiring the GIL Automerge-Triggered-By: GH:encukou
* bpo-16379: expose SQLite error codes and error names in `sqlite3` (GH-27786)Erlend Egeberg Aasland2021-08-303-29/+153
|
* bpo-27334: Fix reference leak introduced by GH-26202 (GH-27942)Erlend Egeberg Aasland2021-08-251-0/+1
|
* bpo-27334: roll back transaction if sqlite3 context manager fails to commit ↵Erlend Egeberg Aasland2021-08-251-7/+21
| | | | | | (GH-26202) Co-authored-by: Luca Citi Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
* bpo-44976: Lazy creation of sqlite3 result rows (GH-27884)Erlend Egeberg Aasland2021-08-252-58/+29
|
* bpo-42064: Pass module state to `sqlite3` UDF callbacks (GH-27456)Erlend Egeberg Aasland2021-08-242-31/+64
| | | | - Establish common callback context struct - Convert UDF callbacks to fetch module state from callback context
* Remove unused UNKNOWN macros from cursor.h and prepare_protocol.h (GH-27885)Erlend Egeberg Aasland2021-08-222-2/+0
|
* bpo-44965: Early exit for non-DML statements in sqlite3.Cursor.executemany() ↵Erlend Egeberg Aasland2021-08-211-8/+7
| | | | (GH-27865)
* bpo-44079: Strip superfluous statement cache from sqlite3.Connection (GH-25998)Erlend Egeberg Aasland2021-08-184-116/+18
|
* bpo-44859: Improve error handling in sqlite3 and and raise more accurate ↵Serhiy Storchaka2021-08-084-33/+52
| | | | | | | | | | | | | | | | | | | | exceptions. (GH-27654) * MemoryError is now raised instead of sqlite3.Warning when memory is not enough for encoding a statement to UTF-8 in Connection.__call__() and Cursor.execute(). * UnicodEncodeError is now raised instead of sqlite3.Warning when the statement contains surrogate characters in Connection.__call__() and Cursor.execute(). * TypeError is now raised instead of ValueError for non-string script argument in Cursor.executescript(). * ValueError is now raised for script containing the null character instead of truncating it in Cursor.executescript(). * Correctly handle exceptions raised when getting boolean value of the result of the progress handler. * Add many tests covering different corner cases. Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-44839: Raise more specific errors in sqlite3 (GH-27613)Serhiy Storchaka2021-08-061-36/+31
| | | | | | MemoryError raised in user-defined functions will now preserve its type. OverflowError will now be converted to DataError. Previously both were converted to OperationalError.
* bpo-44822: Don't truncate `str`s with embedded NULL chars returned by ↵Erlend Egeberg Aasland2021-08-051-3/+10
| | | | `sqlite3` UDF callbacks (GH-27588)
* bpo-31746: Fix broken call in GH-27431 (GH-27464)Erlend Egeberg Aasland2021-07-291-1/+1
|
* bpo-31746: Prevent segfaults when sqlite3.Connection is uninitialised (GH-27431)Erlend Egeberg Aasland2021-07-291-7/+23
|
* bpo-42064: Optimise `sqlite3` state access, part 1 (GH-27273)Erlend Egeberg Aasland2021-07-2913-66/+103
| | | | | | | | | | Prepare for module state: - Add "get state by defining class" and "get state by module def" stubs - Add AC defining class when needed - Add state pointer to connection context - Pass state as argument to utility functions Automerge-Triggered-By: GH:encukou
* bpo-44688: Remove ASCII limitation from `sqlite3` collation names (GH-27395)Erlend Egeberg Aasland2021-07-292-57/+22
|
* bpo-42064: Migrate to `sqlite3_create_collation_v2` (GH-27156)Erlend Egeberg Aasland2021-07-272-27/+17
| | | | | | This implies that SQLite now takes care of destroying the callback context (the PyObject callable it has been passed), so we can strip the collation dict from the connection object.
* bpo-42064: Finalise establishing sqlite3 global state (GH-27155)Erlend Egeberg Aasland2021-07-206-53/+69
| | | | | | With this, all sqlite3 static globals have been moved to the global state. There are a couple of global static strings left, but there should be no need for adding them to the state. https://bugs.python.org/issue42064
* bpo-44641: Use vectorcall in sqlite3 collation callback (GH-27158)Erlend Egeberg Aasland2021-07-151-3/+3
|
* Fix docstring typo in ↵Erlend Egeberg Aasland2021-07-144-8/+8
| | | | | | | | sqlite3.Connection.executescript/sqlite3.Cursor.executescript (GH-27147) Both `executescript` methods contain the same docstring typo: _"Executes a multiple SQL statements at once."_ => _"Executes multiple SQL statements at once."_ Automerge-Triggered-By: GH:pablogsal
* bpo-42064: Move `sqlite3` exceptions to global state, part 2 of 2 (GH-26884)Erlend Egeberg Aasland2021-07-147-82/+90
| | | Automerge-Triggered-By: GH:encukou
* bpo-44491: Allow clearing the sqlite3 authoriser callback (GH-26863)Erlend Egeberg Aasland2021-06-241-6/+10
|
* bpo-42064: Move `sqlite3` exceptions to global state, part 1 of 2 (GH-26745)Erlend Egeberg Aasland2021-06-236-39/+49
| | | Also adds a test to verify the (borrowed) exceptions in `sqlite3.Connection`.
* bpo-42064: Remove stale extern declarations in `sqlite3` headers (GH-26840)Erlend Egeberg Aasland2021-06-235-10/+0
|
* bpo-44087: Disallow instantiation of sqlite3.Statement (GH-26567)Erlend Egeberg Aasland2021-06-201-1/+1
|
* bpo-40956: Convert sqlite3.connect and sqlite3.Connection.__init__ to AC ↵Erlend Egeberg Aasland2021-06-204-71/+276
| | | | (GH-24421)
* bpo-43908: Make heap types converted during 3.10 alpha immutable (GH-26351)Erlend Egeberg Aasland2021-06-175-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make functools types immutable * Multibyte codec types are now immutable * pyexpat.xmlparser is now immutable * array.arrayiterator is now immutable * _thread types are now immutable * _csv types are now immutable * _queue.SimpleQueue is now immutable * mmap.mmap is now immutable * unicodedata.UCD is now immutable * sqlite3 types are now immutable * _lsprof.Profiler is now immutable * _overlapped.Overlapped is now immutable * _operator types are now immutable * winapi__overlapped.Overlapped is now immutable * _lzma types are now immutable * _bz2 types are now immutable * _dbm.dbm and _gdbm.gdbm are now immutable
* bpo-42064: Move sqlite3 types to global state (GH-26537)Erlend Egeberg Aasland2021-06-1512-70/+103
| | | | | | | | | * Move connection type to global state * Move cursor type to global state * Move prepare protocol type to global state * Move row type to global state * Move statement type to global state * ADD_TYPE takes a pointer * pysqlite_get_state is now static inline
* bpo-44329: Refactor sqlite3 statement creation (GH-26566)Erlend Egeberg Aasland2021-06-081-43/+35
| | | | | Call SQLite API's first, and return early in case of error. At the end, allocate the object and initialise members. We now avoid unneeded alloc/dealloc's in case the statement creation fails.
* Fix compiler errors for unused variables (GH-26601)Pablo Galindo2021-06-081-1/+1
|
* bpo-44326: Remove unused members from pysqlite_Statement (GH-26564)Erlend Egeberg Aasland2021-06-062-16/+2
| | | | | * Remove unused db member of pysqlite_Statement * Remove unused sql method from statement object
* bpo-44327: Remove unused members from pysqlite_Connection (GH-26565)Erlend Egeberg Aasland2021-06-062-8/+0
| | | | | * Remove timeout_started * Remove timeout member
* bpo-44304: Ensure the sqlite3 destructor callback is always called with the ↵Pablo Galindo2021-06-052-0/+7
| | | | GIL held (GH-26551)
* bpo-44304: Fix crash in the sqlite3 module when the GC clears Statement ↵Pablo Galindo2021-06-051-7/+4
| | | | objects (GH-26545)
* bpo-44315: Remove unused connection argument from pysqlite_step() (GH-26535)Erlend Egeberg Aasland2021-06-044-7/+8
|
* bpo-43853: Handle sqlite3_value_text() errors (GH-25422)Erlend Egeberg Aasland2021-06-041-8/+11
|
* bpo-44042: Optimize sqlite3 begin transaction (GH-25908)Erlend Egeberg Aasland2021-06-033-46/+38
|
* bpo-42862: Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module ↵Erlend Egeberg Aasland2021-06-037-428/+71
| | | | | (GH-24203) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-42213: Remove redundant cyclic GC hack in sqlite3 (GH-26517)Erlend Egeberg Aasland2021-06-033-21/+2
| | | | | | | | | | The sqlite3 module now fully implements the GC protocol, so there's no need for this workaround anymore. - Add and use managed resource helper for connections using TESTFN - Sort test imports - Split open-tests into their own test case Automerge-Triggered-By: GH:vstinner
* bpo-42213: Check connection in sqlite3.Connection.__enter__ (GH-26512)Erlend Egeberg Aasland2021-06-031-16/+15
| | | | | | | | | Try to harden connection close: - add tests that exercise stuff against a closed database - add wrapper for sqlite3_close_v2() - check connection on __enter__ - explicitly free pending statements before close() - sqlite3_close_v2() always returns SQLITE_OK
* bpo-44165: pysqlite_statement_create now returns a Py object, not an int ↵Erlend Egeberg Aasland2021-06-021-1/+1
| | | | | (GH-26484) GH-26206 was broken by GH-26475.
* bpo-44165: Optimise sqlite3 statement preparation by passing string size ↵Erlend Egeberg Aasland2021-06-023-7/+25
| | | | (GH-26206)