`sqlx-cli`: Divergence between versions: `cargo binstall` vs `cargo install`
While recently investigating the error, I concluded that something was wrong with the compiled version of sqlx-cli.
In brief:
### binstall
cargo binstall sqlx-cli -y --force
sqlx database create --database-url sqlite://test.sqlite.db
# error: error returned from database: (code: 14) unable to open database file
################################################################################
### install
cargo install sqlx-cli --force
sqlx database create --database-url sqlite://test.sqlite.db
# no errors
I'd be happy to help with testing, research if needed
I think it might be related to the features enabled?
https://docs.rs/crate/sqlx-cli/latest/features
I thought so too at first, but sqlite is the default enabled feature -- and if features are not explicitly specified in cargo install (which is our case), the default features will be used by default.
I think it's related to rusqlite
If --features=bundled is enabled, the vendored source of SQLite will be compiled and linked in. SQLite is in the public domain, as described here.
AFAIK the bundled isn't enabled, so sqlx just linked to our system-wide libsqlite3.
That might be the reason for it.
I checked its doc, I didn't find any environment for forcing vendor, only found SQLITE3_STATIC
So it'd be great if sqlx can have a vendored feature to vendor everything, I could enable it in quickinstall.
[dependencies.libsqlite3-sys]
version = "0.30.1"
default-features = false
features = [
"pkg-config",
"vcpkg",
"bundled",
"unlock_notify"
]
(c) source
it looks like a bundled version is being used...
--
Also of note is this ticket (discussion): https://github.com/launchbadge/sqlx/issues/191 , which asks for sqlx to be able to build with system-wide libsqlite.
Update: the issue mentioned above has been finished, but there has been no sqlx release yet
- https://github.com/launchbadge/sqlx/issues/191