* Implement Acquire for PgListener
* Add a test which checks that PgListener implements Acquire
* Drop unnecessary call to `.acquire()`
* Rename test channel to avoid conflict with other tests
* 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>
This isn't a solution for #3484, as that seems to be an issue with privileges on the user's side. However, in the process of figuring that out, I realized we never explicitly test password-less auth.
* fix: fixture macro attribute
* remove extra new line
* add extra new line
* feat: add test for slqx::test macro
* feat: update test for sqlx::test macro
* remove old macro test
* feat: add postgres and sqlite test
* rust format
* cargo fmt
* fix fixtures execution order in test
* 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
* chore: create regression test for #3344
* fix(derives): use a parameter name that's less likely to collide
* breaking(derives): emit `Error::ColumnDecode` when a `TryFrom` conversion fails in `FromRow`
Breaking because `#[sqlx(default)]` on an individual field or the struct itself would have previously suppressed the error. This doesn't seem like good behavior as it could result in some potentially very difficult bugs.
Instead of using `TryFrom` for these fields, just implement `From` and apply the default explicitly.
* fix: run `cargo fmt`
* fix: use correct field in `ColumnDecode`
* feat: add cube
* docs: cube docs
* docs: update readme
* fix: cube is now not feature flagged
* fix: formatting
* fix: typeo for PgCube vs Cube
* fix: correct types
* fix: postgres only types for cube
* fix: cube readme
* fix: dont unwrap cubes
* fix: typo on interval
* fix: zero volume cube array
* fix: return type
* fix: update tests
* fix: run with one test type
* fix: log bytes in error
* fix: typo in test
* fix: log bytes for failed length
* fix: string deser
* docs: remove cube from readme
* fix: int to float
* fix: trim floats
* fix: exttra test
* fix: type safe into vectors
* fix: improve error messages
* docs: remove comments
* fix: front load most important logic and const at start
* fix: extract constants
* fix: flags
* fix: avoid redundant buffer creation and use FromStr trait
* fix: handle serializing
* test: cube vec test
* fix: no array cube test
* fix: update test with array for cube
* fix: dont use try from for u8
* fix: conditionally remove padding
* fix: conditional trimming
* fix: idiomatic trimming
* fix: linting
* fix: remove whitespace
* fix: lower case array
* fix: spacing input
* test: one more vec test
* fix: trim square brackets in case they are using postgres spec page
* fix: result types
* fix: format
* fix: box error
* fix: the borrow produces a value
* fix: self serialise
* chore: merge main
* fix: borrow
* fix: clippy
---------
Co-authored-by: James Holman <james.holman@betashares.com.au>
* 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
* Include test case for regular subtransactions
While using COPY and subtransactions I kept running into errors.
This test case documents that error, it currently fails with:
Error: encountered unexpected or invalid data: expecting ParseComplete but received CommandComplete
* PostgreSQL Copy: Consume ReadyForQuery on error
When a COPY statement was in error inside a subtransaction,
a Protocol Error used to be raised. By consuming the ReadyForQuery
message when there is an error, we no longer have this issue.
* test: add a failing test
* feat: add no_tx to migration struct
* feat: execute migration with no tx block
* fix: expected string literal compilation error
* test: update no tx to content comment
* refactor: use the sql comment instead of file name semantics
* docs: remove no_tx from file format comment
* fix: remove filename matches
* fix: messed up merge
* refactor: dedupe migration
* fix: move comment to where it makes sense
* fix: linter error
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
Also clarifies the handling of `TIME` (we never realized it's used for both time-of-day and signed intervals) and adds appropriate impls for `std::time::Duration`, `time::Duration`, `chrono::TimeDelta`
This is meant to be much easier to discover than the current approach of directly invoking `Executor` methods.
In addition, I'm improving documentation for the `query*()` functions across the board.
* feat: add fixtures_path
* test: add test for fixtures_path
* docs: expand test docs with fixtures_path
* test: add new test instead of co-opting and old one.
* feat: add explicit path operating mode for fixtures parameters and allow combining multiple fixtures parameters
* fix: require .sql extension for explicit path fixtures
* feat: add custom relative path style to fixtures argument
* fix: missing cfg feature
* docs: update
* fix: explicit fixtures styling checks for paths. Remove strict sql extension requirement for explicit path, they still need an extension. Add .sql extension to implicit fixtures style only if missing.
* style: cargo fmt
* docs: update documentation
* chore:Added ipaddr extension library to gitignore
* fix:In a Linux environment, shared libraries in the current directory are not loaded, so add the current directory to the LD_LIBRARY_PATH environment variable.
* fix: Since confrict primary key when running multiple sqlite tests, removed specific primary key in insert.
* chore: Since avoid git modified targeting, copy the db file to new test db file.
* fix: Since docker mysql 5.7 using yaSSL(It only supports TLSv1.1), avoid running when using rustls.
* feat(citext): implement citext for postgres
* feat(citext): add citext -> String conversion test
* feat(citext): fix ltree -> citree
* feat(citext): add citext to the setup.sql
* chore: address nits to #2478
* Rename `PgCitext` to `PgCiText`
* Document when use of `PgCiText` is warranted
* Document potentially surprising `PartialEq` behavior
* Test that the macros consider `CITEXT` to be compatible with `String` and friends
* doc: add `PgCiText` to `postgres::types` listing
* chore: restore missing trailing line break to `tests/postgres/setup.sql`
---------
Co-authored-by: Austin Bonander <austin@launchbadge.com>