Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use apsw instead of sqlite #1

Merged
merged 19 commits into from
Dec 20, 2024
Merged

Use apsw instead of sqlite #1

merged 19 commits into from
Dec 20, 2024

Conversation

pydanny
Copy link
Contributor

@pydanny pydanny commented Dec 5, 2024

Replaces the built-in Python binding with the apsw library

Notes about the migration / Future PRs

  1. To minimize changes and make reviewing easier, we import apsw as sqlite3 and set OperationError to apsw.Error. In a soon-to-be-submitted PR we will change sqlite3 to apsw
  2. In a series of future PRs we will begin to move from the generic OperationError (shim of apsw.Error) to more precise errors
  3. Transformations can be improved/expanded https://www.sqlite.org/lang_altertable.html#making_other_kinds_of_table_schema_changes
  4. This doesn't remove the remainder of rowid, that will happen in another PR

Reasons:

  • Improved performance on Python 3.12: Internal tests show it can handle ~100-200x more concurrent reads than sqlite3 without configuration
  • Easier to config
  • Better stack traces
  • More precise errors, including built-in support for Busy Handling

Source AnswerDotAI/sqlite-minutils#44

Tests

pydanny and others added 5 commits December 5, 2024 10:10
Co-authored-by: Audrey Roy Greenfeld <[email protected]>
Co-authored-by: Audrey Roy Greenfeld <[email protected]>
Co-authored-by: Audrey Roy Greenfeld <[email protected]>
Co-authored-by: Audrey Roy Greenfeld <[email protected]>
@pydanny pydanny marked this pull request as draft December 5, 2024 10:12
@pydanny pydanny changed the title Use apsw instead of sqlite WIP: Use apsw instead of sqlite Dec 5, 2024
@pydanny pydanny requested review from audreyfeldroy and jph00 and removed request for jph00 December 10, 2024 20:53
@pydanny pydanny marked this pull request as ready for review December 13, 2024 15:27
@pydanny pydanny changed the title WIP: Use apsw instead of sqlite Use apsw instead of sqlite Dec 13, 2024
@pydanny
Copy link
Contributor Author

pydanny commented Dec 19, 2024

@pydanny pydanny requested a review from jph00 December 19, 2024 19:34
Co-authored-by: Audrey Roy Greenfeld <[email protected]>
@jph00 jph00 merged commit 3932007 into main Dec 20, 2024
@jph00
Copy link
Contributor

jph00 commented Dec 20, 2024

Exciting!

@jph00 jph00 deleted the apsw branch December 20, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants