* fix(postgres): don't panic if `M` or `C` Notice fields are not UTF-8
This has been observed with an old version of PostgreSQL (11.0.4)
running on Windows Server 2016 with windows-1252 encoding and French
locale.
This change replaces invalid UTF-8 fields with a default string, so the
other fields can still be read if they are valid.
* Revert "fix(postgres): don't panic if `M` or `C` Notice fields are not UTF-8"
This reverts commit 362ca98bbd.
* Check that Notice M and C fields are valid UTF-8
Otherwise, we return the invalid UTF-8 error to avoid panicking later.
* 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>
The names for the SSL mode options were incorrect, added test for making
sure the built url can be parsed to ensure internal consistency at
least. Also changed "ssl-mode" to "sslmode" as it seems more standard
and sqlx can parse both.
* 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>
* Revert "fix(ci): disable `mariadb_verylatest` pass for RusTLS"
This reverts commit c78425b3ac.
MariaDB 11.4.2 now includes the upstream fix for this.
Closes: 3091
* ci: mariadb 11.4 now GA/Stable
* feat: support `NonZero*` scalar types
This commits adds `Type`, `Encode`, and `Decode` impls for all the
`NonZero*` types from the standard library. They are implemented as
direct proxies to their primitive counterparts, except that when
decoding, the values are checked to not be zero.
* fixup!: remove `non-zero` cargo feature
* fixup!: make `non-zero` module private
* fixup!: rebase and fix trait impls
* 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: make resolve_blocking not take ownership of path
When using sqlx_macros_unstable the codepath taken further uses the path
variable and it is more convenient to not take ownership but instead
pass references to needed functions.
* fix: change &PathBuf to &Path in resolve_blocking
* 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>