breaking: make offline optional to allow building without serde
#4077
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.
This ties the
offlinefeature to themacrosfeature, allowing for builds withoutserde.I opted to make the
Executor::describefunction feature gated onoffline. This seemed like the simplest option, assuming it only exists to serve themacrofeature. But I'd understand if you'd wanted to go with a different approach.Outside of the feature cfg additions, I also had to remove the use of
serde_urlencodedfromsqlx-sqlite, manually encoding the key/values instead.One issue is that the CI currently doesn't test building without the
macrosfeature at all.In terms of compile time performance, running
LIBSQLITE3_SYS_USE_PKG_CONFIG=1 cargo build --release --no-default-features --features runtime-smol,migrate,all-databasesresulted in a drop from 28s to 21s with these changes.Does your PR solve an issue?
Fixes #4070
Is this a breaking change?
Yes, due to altering features at the
sqlxlevel.Though this will only impact anyone setting
default-features = false.And due to changing the executor
sqlx-coreAPI by adding the feature gate.