-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add a "sqlite-unbundled" feature that dynamically links to system libsqlite3.so library #3507
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0a25254
Add a "sqlite-unbundled" feature that dynamically links to system lib…
lilydjwg 60b633b
update README abouot the newly-added `sqlite-unbundled` feature
lilydjwg 6b4876d
Update README.md to make it clear with bulleted list
lilydjwg 6cee67e
more cfg feature updates
lilydjwg 937096a
update documentation in sqlx-sqlx/src/lib.rs too
lilydjwg 9136a4f
cargo fmt
lilydjwg 877af00
Add "sqlite-unbundled" feature to sqlx-cli
lilydjwg 7431d17
Add sqlite-unbundled to gituhb actions tests
lilydjwg ff30bc6
cfg(feature = "sqlite") => cfg(any(feature = "sqlite", feature = "sql…
lilydjwg ea41477
fix
lilydjwg 71f3e7d
CI: make sqlite-unbundled tests workaround required-features
lilydjwg b45a967
use an internal "_sqlite" feature to do the conditional compilation
lilydjwg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we specifically didn't want this because of the hit to build times it would cause.
I suppose if people are willing to accept that to link their own SQLite, then it's fine, but then this needs to be clearly documented.
Unfortunately, it looks to be required because the current pre-generated bindings are for version 3.14.0 but we need
sqlite3_prepare_v3()
which was introduced in 3.20.0, which is 7 years old at this point: https://www.sqlite.org/changes.html#version_3_20_0There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(A large part of the reason for going with
bundled
in the first place was just a general disdain amongst us for how slowly things move with system packages, especially in a lot of Linux distributions.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we really only use
sqlite3_prepare_v3
to passSQLITE_PREPARE_PERSISTENT
as an optimization, but it does seem somewhat important: https://www.sqlite.org/c3ref/c_prepare_normalize.html#sqlitepreparepersistentIt looks like
sqlite3_prepare_v2()
behaves the same as_v3()
withprepFlags = 0
: https://github.com/sqlite/sqlite/blob/a95620c1414b06ac73b656b518ae364ff41f1e81/src/prepare.c#L954The way the lookaside allocator is described to work, it seems quite detrimental to hold onto prepared statement handles using it for very long, as running out of lookaside memory means spilling over to regular
malloc()
calls, defeating the whole purpose of the lookaside allocator to begin with: https://www.sqlite.org/malloc.html#lookasideThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked repology and it seems that only ancient distros are shipping a too old sqlite, e.g. CentOS 7. (Some are shipping sqlite 2.x in addition and the naming is quite mixed.)