summaryrefslogtreecommitdiffstats
path: root/Lib/sqlite3
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-108550: Fix sqlite3 CLI regression from gh-108551 (GH-108618) ↵Miss Islington (bot)2023-08-291-1/+1
| | | | | | | | (#108621) gh-108550: Fix sqlite3 CLI regression from gh-108551 (GH-108618) (cherry picked from commit c8847841cc5629cbceead0c09dc6f537d7b92612) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-108550: Speed up sqlite3 tests (GH-108551) (#108566)Miss Islington (bot)2023-08-281-3/+6
| | | | | | | | | | | | | | | | | | gh-108550: Speed up sqlite3 tests (GH-108551) Refactor the CLI so we can easily invoke it and mock command-line arguments. Adapt the CLI tests so we no longer have to launch a separate process. Disable the busy handler for all concurrency tests; we have full control over the order of the SQLite C API calls, so we can safely do this. The sqlite3 test suite now completes ~8 times faster than before. (cherry picked from commit 0e8b3fc718c8a1c4de558c553d9e05049c1dbec6) Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-64662: Fix virtual table support in sqlite3.Connection.iterdump ↵Erlend E. Aasland2023-08-281-7/+13
| | | | | | | | | | | | | | | | | | | (#108340) (#108563) * [3.12] gh-64662: Add virtual table support to sqlite3.Connection.iterdump (#108340) (cherry picked from commit d0160c7c22c8dff0a61c49b5304244df6e36465e) Co-authored-by: Aviv Palivoda <palaviv@gmail.com> * The _quote_value helper is not part of 3.12; spell out the replacement * With quotes * Ok, let's use explicit quoting --------- Co-authored-by: Aviv Palivoda <palaviv@gmail.com>
* gh-102628: Fix sqlite3 CLI prompt in IDLE on Windows (#103945)Erlend E. Aasland2023-04-271-1/+4
|
* gh-102628: Fix sqlite3 CLI prompt for Windows console users (#103898)Erlend E. Aasland2023-04-271-1/+2
| | | | The prompt will still be incorrect in IDLE on Windows, as IDLE uses CTRL-D for EOF on all platforms.
* gh-95273: Improve sqlite3.complete_statement docs (#95840)Erlend E. Aasland2022-08-111-0/+23
| | | | Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com> Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
* gh-77617: Add sqlite3 command-line interface (#95026)Erlend Egeberg Aasland2022-08-011-0/+97
| | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-90016: Deprecate default sqlite3 adapters and converters (#94276)Erlend Egeberg Aasland2022-07-201-0/+9
| | | Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
* gh-79009: sqlite3.iterdump now correctly handles tables with autoincrement ↵itssme2022-06-191-1/+13
| | | | | (#9621) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-93370: Deprecate sqlite3.version and sqlite3.version_info (#93482)Kalyan2022-06-072-1/+26
| | | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-92547: Remove deprecated sqlite3 features (#92548)Erlend Egeberg Aasland2022-05-162-28/+0
| | | | | | | | | | The following sqlite3 features were deprecated in 3.10, scheduled for removal in 3.12: - sqlite3.OptimizedUnicode (gh-23163) - sqlite3.enable_shared_cache (gh-24008) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Signed-off-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* Fix typo in the sqlite3 docs (GH-31915)Jonathan2022-03-281-1/+1
| | | Co-authored-by: Jonathan <89750679+AHypnotoad@users.noreply.github.com>
* bpo-45677: Reword first section of `sqlite3` docs (#29326)Erlend Egeberg Aasland2021-11-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-45677: Avoid addressing the reader as 'you' in sqlite3 docs * Adjust wording * Adjust wording again * Typo * Update Doc/library/sqlite3.rst Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com> * Address review: adjust wording * Update Doc/library/sqlite3.rst Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> * Update Lib/sqlite3/__init__.py Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> * Update Doc/library/sqlite3.rst Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> * Update Doc/library/sqlite3.rst Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> * Update Lib/sqlite3/__init__.py Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> * Update Doc/library/sqlite3.rst Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> * Apply Alex' suggestion, and apply 80 char limit to PR * Minor adjustment Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* bpo-45613: Set `sqlite3.threadsafety` dynamically (GH-29227)Erlend Egeberg Aasland2021-11-031-2/+0
| | | | | | | | | Use the compile-time selected default SQLite threaded mode to set the DB-API 2.0 attribute 'threadsafety' Mappings: - SQLITE_THREADSAFE=0 => threadsafety=0 - SQLITE_THREADSAFE=1 => threadsafety=3 - SQLITE_THREADSAFE=2 => threadsafety=1
* bpo-10572: Move `sqlite3` tests to `Lib/test` (GH-29304)Erlend Egeberg Aasland2021-10-2910-3895/+0
| | | Automerge-Triggered-By: GH:brettcannon
* bpo-45612: Add sqlite3 module docstring (GH-29224)Erlend Egeberg Aasland2021-10-281-0/+34
|
* bpo-16379: Fix SQLite version checks in test_module_constants() (GH-28809)Erlend Egeberg Aasland2021-10-071-2/+2
| | | Automerge-Triggered-By: GH:pablogsal
* bpo-45041: Restore `sqlite3` executescript behaviour for `SELECT` queries ↵Erlend Egeberg Aasland2021-10-071-0/+11
| | | | | | | (GH-28509) * bpo-45041: Restore sqlite3 executescript behaviour for select queries * Add regression test
* Fix typos in the Lib directory (GH-28775)Christian Clauss2021-10-061-1/+1
| | | | | Fix typos in the Lib directory as identified by codespell. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-44958: Fix ref. leak introduced in GH-27844 (GH-28490)Erlend Egeberg Aasland2021-09-212-30/+36
| | | | | | Modify managed_connect() helper to support in-memory databases. Use it for the regression tests added in GH-27844. Automerge-Triggered-By: GH:pablogsal
* bpo-44958: Only reset `sqlite3` statements when needed (GH-27844)Erlend Egeberg Aasland2021-09-211-7/+42
|
* Fix typo in Lib/sqlite3/test/test_types.py (GH-28226)Konstantin Popov2021-09-151-1/+1
| | | | | preceeding -> preceding Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-45181: Simplify loading sqlite3 tests (GH-28304)Serhiy Storchaka2021-09-139-135/+9
| | | | | Use unittest discover instead of manually enumerating all test modules and classes. Also add support for filtering them by pattern.
* bpo-45041: Increase coverage for sqlite3.Cursor.executescript() (GH-28074)Erlend Egeberg Aasland2021-08-301-0/+7
|
* bpo-16379: expose SQLite error codes and error names in `sqlite3` (GH-27786)Erlend Egeberg Aasland2021-08-301-2/+85
|
* bpo-43398: Add test for defect connection factories (GH-27966)Erlend Egeberg Aasland2021-08-301-10/+12
|
* bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021)Serhiy Storchaka2021-08-292-2/+5
|
* bpo-27334: roll back transaction if sqlite3 context manager fails to commit ↵Erlend Egeberg Aasland2021-08-251-1/+79
| | | | | | (GH-26202) Co-authored-by: Luca Citi Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
* bpo-44859: Improve error handling in sqlite3 and and raise more accurate ↵Serhiy Storchaka2021-08-085-19/+166
| | | | | | | | | | | | | | | | | | | | 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-1/+44
| | | | | | 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-0/+28
| | | | `sqlite3` UDF callbacks (GH-27588)
* bpo-31746: Prevent segfaults when sqlite3.Connection is uninitialised (GH-27431)Erlend Egeberg Aasland2021-07-291-0/+21
|
* bpo-44688: Remove ASCII limitation from `sqlite3` collation names (GH-27395)Erlend Egeberg Aasland2021-07-292-3/+2
|
* bpo-44491: Allow clearing the sqlite3 authoriser callback (GH-26863)Erlend Egeberg Aasland2021-06-242-0/+7
|
* bpo-43553: Improve `sqlite3` test coverage (GH-26886)Erlend Egeberg Aasland2021-06-244-2/+100
|
* bpo-42064: Move `sqlite3` exceptions to global state, part 1 of 2 (GH-26745)Erlend Egeberg Aasland2021-06-231-0/+18
| | | Also adds a test to verify the (borrowed) exceptions in `sqlite3.Connection`.
* bpo-44430: Refactor `sqlite3` threading tests (GH-26748)Erlend Egeberg Aasland2021-06-201-140/+36
| | | | | | | 1. Rewrite ThreadTests with a _run_test() helper method that does the heavy lifting 2. Add test.support.threading_helper.reap_threads to _run_test() 3. Use _run_test() in all threading tests 4. Add test case for sqlite3.Connection.set_trace_callback 5. Add test case for sqlite3.Connection.create_collation
* bpo-44087: Disallow instantiation of sqlite3.Statement (GH-26567)Erlend Egeberg Aasland2021-06-201-0/+5
|
* bpo-40956: Convert sqlite3.connect and sqlite3.Connection.__init__ to AC ↵Erlend Egeberg Aasland2021-06-201-0/+21
| | | | (GH-24421)
* bpo-44304: Fix crash in the sqlite3 module when the GC clears Statement ↵Pablo Galindo2021-06-051-0/+17
| | | | objects (GH-26545)
* bpo-43853: Handle sqlite3_value_text() errors (GH-25422)Erlend Egeberg Aasland2021-06-041-5/+7
|
* bpo-44041: Add test for sqlite3 column count (GH-25907)Erlend Egeberg Aasland2021-06-041-0/+11
|
* bpo-42213: Remove redundant cyclic GC hack in sqlite3 (GH-26517)Erlend Egeberg Aasland2021-06-032-18/+35
| | | | | | | | | | 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-0/+20
| | | | | | | | | 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
* sqlite3 test suite now works with SQLITE_DQS=0 (GH-26032)Erlend Egeberg Aasland2021-05-141-1/+1
|
* bpo-43296: Handle sqlite3_value_blob() errors (GH-24674)Erlend Egeberg Aasland2021-04-141-0/+4
|
* bpo-43265: Improve sqlite3.Connection.backup error handling (GH-24586)Erlend Egeberg Aasland2021-04-141-4/+1
|
* bpo-43752: Fix sqlite3 regression for zero-sized blobs with converters ↵Erlend Egeberg Aasland2021-04-141-1/+3
| | | | (GH-25228)
* bpo-43369: sqlite3_column_{text,blob} failures now raise MemoryError (GH-24723)Erlend Egeberg Aasland2021-03-041-1/+22
|
* bpo-43368: Fix fetching empty bytes in sqlite3 (GH-24706)Mariusz Felisiak2021-03-031-0/+4
| | | Regression introduced in 47feb1feb28631b6647699b7633109aa85340966.