summaryrefslogtreecommitdiffstats
path: root/Lib/sqlite3
Commit message (Collapse)AuthorAgeFilesLines
* gh-91818: Use default program name in the CLI of many modules (GH-124867)Serhiy Storchaka2024-10-091-1/+0
| | | | | | As argparse now detects by default when the code was run as a module. This leads to using the actual executable name instead of simply "python" to display in the usage message ("usage: python -m ...").
* gh-120417: Add #noqa to used imports in the stdlib (#120421)Victor Stinner2024-06-131-1/+1
| | | | | Tools such as ruff can ignore "imported but unused" warnings if a line ends with "# noqa: F401". It avoids the temptation to remove an import which is used effectively.
* gh-118924: Remove `sqlite3.version` and `sqlite3.version_info` (#118925)Hugo van Kemenade2024-05-102-26/+1
|
* gh-118221: Always use the default row factory in sqlite3.iterdump() (#118223)Erlend E. Aasland2024-04-251-0/+1
| | | | | | | | | | | | sqlite3.iterdump() depends on the row factory returning resulting rows as tuples; it will fail with custom row factories like for example a dict factory. With this commit, we explicitly reset the row factory of the cursor used by iterdump(), so we always get predictable results. This does not affect the row factory of the parent connection. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-91602: Add iterdump() support for filtering database objects (#114501)Mariusz Felisiak2024-02-061-5/+14
| | | | | | Add optional 'filter' parameter to iterdump() that allows a "LIKE" pattern for filtering database objects to dump. Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-108364: In sqlite3, disable foreign keys before dumping SQL schema (#113957)Mariusz Felisiak2024-01-121-0/+4
| | | | | | | sqlite3.Connection.iterdump now ensures that foreign key support is disabled before dumping the database schema, if there is any foreign key violation. Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-109151: Enable readline in the sqlite3 CLI (GH-109152)Serhiy Storchaka2023-10-041-0/+4
|
* gh-108590: Revert gh-108657 (commit 400a1cebc) (#108686)Erlend E. Aasland2023-08-301-25/+2
| | | Reverted per Serhiy's request.
* gh-108590: Fix sqlite3.iterdump for invalid Unicode in TEXT columns (#108657)Corvin2023-08-301-2/+25
| | | Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-108550: Fix sqlite3 CLI regression from gh-108551 (#108618)Erlend E. Aasland2023-08-291-1/+1
|
* gh-108550: Speed up sqlite3 tests (#108551)Erlend E. Aasland2023-08-281-3/+6
| | | | | | | | | | | | | 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. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-64662: Add virtual table support to sqlite3.Connection.iterdump (#108340)Erlend E. Aasland2023-08-271-7/+13
| | | Co-authored-by: Aviv Palivoda <palaviv@gmail.com>
* gh-108364: Simplify quoting values and identifiers in sqlite3's iterdump() ↵Mariusz Felisiak2023-08-251-7/+18
| | | | (#108472)
* 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)