* Add a "sqlite-unbundled" feature that dynamically links to system libsqlite3.so library
* update README abouot the newly-added `sqlite-unbundled` feature
* Update README.md to make it clear with bulleted list
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
* more cfg feature updates
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
* update documentation in sqlx-sqlx/src/lib.rs too
and also mention possible build time increasement.
* cargo fmt
* Add "sqlite-unbundled" feature to sqlx-cli
* Add sqlite-unbundled to gituhb actions tests
* cfg(feature = "sqlite") => cfg(any(feature = "sqlite", feature = "sqlite-unbundled"))
* fix
* CI: make sqlite-unbundled tests workaround required-features
by duplicating the relevant test section
* use an internal "_sqlite" feature to do the conditional compilation
---------
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
* sqlite: fix inconsistent read-after-write
fetch_one/fetch_optional
* try pushing fetch_optional early-return into worker
* run cargo fmt
* fix "it_can_execute_multiple_statements" test failure
* use Option<usize> instead of bespoke enum for rows returned
* fix(ci): update workflows/examples.yml
* Removed archived `actions-rs` actions
* Upgraded `Swatinem/rust-cache`, `actions/checkout`, `actions/download-artifact`, `actions/upload-artifact`
* chore: deprecate `AnyKind`
* fix: remove dead references to DB features in `sqlx-core`
This reactivates a couple of tests that had stopped working.
* chore(ci): move sqlx-cli checks to their own workflow
* fix(ci): remove remaining `uses: actions-rs/cargo`
* fix warnings
* chore: add titles to sqlx-cli jobs
* fix warnings (2)
* fix error in pool example
* fix warnings (3)
* fix query_builder test
* fix: don't run CLI tests on Windows
* chore: upgrade `rust-toolchain` to 1.80
* fix(postgres): fix missing Tokio specialization in `PgCopyIn`
Caught by the new `unexpected_cfgs` lint.
* fix new warnings
* Fixed some rust docs intra-doc non functioning links
* Minor tweaks
* Added warning for MSSQL not being functional yet
* Fixed requested changes
* Readded missing time
* Aligned table
* feat: Add set_update_hook on SqliteConnection
* refactor: Address PR comments
* fix: Expose UpdateHookResult for public use
---------
Co-authored-by: John Smith <asserta4@gmail.com>
* convert logger to output a query graph
* avoid duplicating branch paths to shrink output graph
* separate different branching paths
* include all branches which found unique states
* track the reason for ending each branches execution
* track the result type of each branch
* make edges rely on history index instead of program_id, to avoid errors when looping
* add state diff to query graph
* drop redundant table info
* rework graph to show state changes, rework logger to store state snapshots
* show state on the previous operation
* gather duplicate state changes into clusters to reduce repetition
* draw invisible connections between unknown instructions by program_i
* clean up dot format string escaping
* add test case from #1960 (update returning all columns)
* add tests for #2939 (update returning only the PK column)
* allow inserting into a table using only the index
* improve null handling of IfNull, fix output type of NewRowId
* add NoResult nodes for branches which don't log a result, as a sanity check
* add short-circuit to all logging operations
* remove duplicate logging checks, and make logging enabled/disabled consistently depend on sqlx::explain instead of sqlx for capture & sqlx::explain for output
* add failing test for awkwardly nested/filtered count subquery
* handle special case of return operation to fix failing test
* require trace log level instead of using whatever log level statement logging was configured to use
* Make encode and encode_by_ref fallible
This only changes the trait for now and makes it compile, calling .expect() on all users. Those will be removed in a later commit.
* PgNumeric: Turn TryFrom Decimal to an infallible From
* Turn panics in Encode implementations into errors
* Add Encode error analogous to the Decode error
* Propagate decode errors through Arguments::add
This pushes the panics one level further to mostly bind calls. Those will also be removed later.
* Only check argument encoding at the end
* Use Result in Query internally
* Implement query_with functions in terms of _with_result
* Surface encode errors when executing a query.
* Remove remaining panics in AnyConnectionBackend implementations
* PostgreSQL BigDecimal: Return encode error immediately
* Arguments: Add len method to report how many arguments were added
* Query::bind: Report which argument failed to encode
* IsNull: Add is_null method
* MySqlArguments: Replace manual bitmap code with NullBitMap helper type
* Roll back buffer in MySqlArguments if encoding fails
* Roll back buffer in SqliteArguments if encoding fails
* Roll back PgArgumentBuffer if encoding fails
* fix: sqlite pragma order for auto_vacuum
Setting the auto_vacuum pragma must come before setting the journal
mode otherwise it won't apply.
* fix: better documentation for auto_vacuum
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
---------
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
Breaking changes:
* integer decoding will now loudly error on overflow instead of silently truncating.
* some usages of the query!() macros might change an i32 to an i64.
Also adds support for *decoding* `u64`s because there's no reason not to.
Closes#3179
* HasValueRef, HasArguments, HasStatement -> Database GATs
replace the associated types from the generic traits
`HasValueRef<'r>`, `HasArguments<'q>` and `HasStatement<'q>`
with generic associated types in `Database`
* fixup after rebase
---------
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
* feat: add get_url to connect options
Add a get_url to connect options and implement it for all needed types;
include get_filename for sqlite. These changes make it easier to test
sqlx.
* refactor: use expect with message
* refactor: change method name to `to_url_lossy`
* fix: remove unused imports
Inlined format args make code more readable, and code more compact.
I ran this clippy command to fix most cases, and then cleaned up a few trailing commas and uncaught edge cases.
```
cargo clippy --bins --examples --benches --tests --lib --workspace --fix -- -A clippy::all -W clippy::uninlined_format_args
```