* chore: add doc example for manual implemenation of FromRow trait
* fix typo
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
* chore: use `sqlx::Result` directly
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
* Add in an example of how to use separated
Dearest Maintainer,
Thank you for your work on this project. I started using query builder today and I have enjoyed it. I did have a hard time figuring out how best to use separated to generate the values for an IN statement. It is my hope that adding an example will save someone else a few minutes of code reading or compile time. I wrote the example in the github text editor but It looks correct.
Thanks again for your work on this.
Becker
* end ```
* Apply cfg and end ```
* remove dup
* Update sqlx-core/src/query_builder.rs
* fix(postgres): don't panic if `S` or `V` Notice fields are not UTF-8
* fix: run `cargo update` to rotate cache key
for some reason there's some bad compiler artifacts cached
* use direct blocking calls for SQLite in `sqlx_macros`
* this also ensures the database is closed properly, cleaning up tempfiles
* don't send `PRAGMA journal_mode` unless set
* this previously defaulted to WAL mode which is a permanent setting
on databases which doesn't necessarily apply to all use-cases
* changing into or out of WAL mode acquires an exclusive lock on the database
that can't be waited on by `sqlite3_busy_timeout()`
* for consistency, `sqlx-cli` commands that create databases will still
create SQLite databases in WAL mode; added a flag to disable this.
* in general, don't send `PRAGMA`s unless different than default
* we were sending a bunch of `PRAGMA`s with their default values just to enforce
an execution order on them, but we can also do this by inserting empty slots
for their keys into the `IndexMap`
* add error code to `SqliteError` printout
* document why `u64` is not supported
* feat(sqlite): Add 'time' crate support for date/time types
docs(sqlite): Update types module docs for JSON and Chrono
docs(mysql): Update types module docs for JSON
* More efficient time crate decoding with FormatItem::First and hand-crafting of format descriptions
* Replace temporary testing code with original intention
* Replace duplicated formatting test with intended test
* Performance improvements to decoding OffsetDateTime, PrimitiveDateTime, and Time
* Use correct iteration for OffsetDateTime
* Reduce visibility of format constants
Co-authored-by: John B Codes <johnbcodes@users.noreply.github.com>
This function can panic due to slicing out of bounds when the server
responds without the `\x` prefix. With this commit we instead error and
also ensure that the prefix is what we expect instead of blindly
removing it.
Not directly related to the panic, we replace as_str() with as_bytes()
because there is no reason to perform a utf8 validity check when
hex::decode already checks that the content is valid.
To not break the API we need to use an Arc instead of a Box for the
callback functions. Alternatively we could require all the function to
be Clone, but that would be a breaking change.
* pool: fix panic when using callbacks
add regression test
* pool: fix panic when using callbacks
add regression test
added missing typedef `MssqlPoolOptions`
* fix#1905 : replaced all uses of "uri" to "url"
* rebase commits
resolved conflicts in mod.rs
fixed conflict in options.rs
Update options.rs
Update options.rs
Update options.rs
* Fixed leak of `Arc<SharedPool>` in `DecrementSizeGuard::cancel()`
* Renamed `PoolOptions::connect_timeout` to `acquire_timeout` for clarity.
* Fixed `/* SQLx ping */` showing up in Postgres query logs
* Made `.close()` a regular function that returns a `Future`
* Deleted deprecated method `PoolConnection::release()`
* Document why connection might be dropped if `Pool::acquire()` is cancelled
* Added connection metadata to pool lifecycle callbacks
* Improved guarantees for `min_connections`
* Fixed `num_idle()` to not spin forever at high load
* Improved documentation across the `pool` module
* reproduce incorrect nullability for materialized views
* split ephemeral/index-only table handling from real table handling
* add test for literal null, expect nullability to be identified from table information
* gather interpreter state into a struct, no change in behaviour
* prevent infinite loops that could arise once branching is supported
* track nullability alongside the datatype instead of in a separate lookup
* implement basic comprehension of branching opcodes
* fix datatype calculation of aggregates which are never 'stepped' through
* implement coroutine and return operations, including tracking of 'actual' integer value stored in the register by Integer/InitCoroutine/Yield operations.
* strip unnecessary history field out
* Modify variable test to expect bind-variable outputs to be nullable, rather than unknown
* add partially commented-out union tests, simplify code to satisfy simplest union case
* fix unit test incorrectly expecting primary keys to be implicitly not-null
* add failing test for recursive tables
* add logging of query explain plan
* track explain plan execution history
* broken RowData implementation (doesn't alias)
* Implement OpenPseudo tables as an alias of a register value
* fix comment
* clean up logging code warnings
* use cfg to omit QueryPlanLogger unless sqlite feature is used
* query_as: don't stop stream after decoding error
Fixes https://github.com/launchbadge/sqlx/issues/1884
When a single row cannot be converted to the target type of query_as,
it should not prevent the library user from accessing the other rows
Otherwise, the user cannot access all query results in query_as.
* use union in tests to maximize db compatibility
* changed [] access to .get() to return result instead of panic
* changed error type to protocol err
* fixed issue with comparing ref
* cargo fmt
Co-authored-by: Erik Rhodes <erik@space-nav.com>
Postgres arrays and records do not fully support custom types. When encountering an unknown OID, they currently default to using `PgTypeInfo::with_oid`. This is invalid as it breaks the invariant that decoding only uses resolved types, leading to panics.
This commit returns an error instead of panicking. This is merely a mitigation: a proper fix would actually add full support for custom Postgres types. Full support involves more work, so it may still be useful to fix this immediate issue.
Related issues:
- https://github.com/launchbadge/sqlx/issues/1672
- https://github.com/launchbadge/sqlx/issues/1797
* refactor: Reuse a cached connection instead of always recreating for `sqlx-macros`
* fix: Fix type inference issue when no database features used
* refactor: Switch cached db conn to an `AnyConnection`
* fix: Fix invalid variant name only exposed with features
* fix: Tweak connection options for SQLite with `sqlx-macros`
* fix: Remove read only option for SQLite connection
* fix: Fix feature flags regarding usage of `sqlx_core::any`
* Make PgLTree::push infallible and take PgLTreeLabel directly.
Previously the function took strings and parsed them into
PgLTreeLabel internally, now it's possible to directlry push
PgLTreeLabels onto a PgLTree.
* Push PgLTree String conversion to label.
* rebase and fix compile error
Co-authored-by: Austin Bonander <austin@launchbadge.com>