* Implement Clone for PoolOptions manually (#2548)
Trying to derive `Clone` automatically for `PoolOptions` results
in errors when `clone` is actually called. This is because the
derive incorrectly determines that `Clone` is _not_ derivable
due to the lack of `Clone` implementation on the `DB: Database`
type parameter, even though no value of that type is actually
stored in a to-be-cloned position (in fact, it's only used for
the `Connection` associated type on the type parameter's
`Database` trait impl).
Manually implementing `Clone` side-steps this issue and insures
the type is always actually cloneable.
For reference: https://github.com/launchbadge/sqlx/issues/2548
* Ran 'cargo fmt'
* Simplified Arc cloning
The documentation for `PgAdvisoryLockGuard` lists a set of types
that should be able to be passed to it, but when actually trying
to do so, compilation would fail due to missing `AsMut` trait
implementations for those types. This commit adds the missing
`AsMut` impls so that `Transaction` and `PgConnection` can be used
as type parameters to `PgAdvisoryLockGuard`, as expected.
For reference: https://github.com/launchbadge/sqlx/issues/2520
* sqlx-macros-core: Add handling of the 'DATE' pseudo-type in in the sqlite library.
Presently this only functions for the `time` feature, because I don't use the `chrono` feature.
* Update sqlite.rs
Add chrono date support.
* Update sqlite.rs
rustfmt
* Update sqlite.rs
Switch order of time::OffsetDateTime and time::PrimitiveDateTime.
* Exposing the Oid of PostgreSQL types
* Do not panic if OID is not set
* Update sqlx-postgres/src/type_info.rs
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
* cargo fmt
---------
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
This adds a newline at the end of all cached ./.sqlx/... JSON files so that anyone who has "auto-newline" enabled in their IDE would not accidentally add it to the cached file. This also ensures that GitHub diff would not show an alarming red icon next to the end of the checked in sqlx files.
* Traverse symlinks when resolving migrations
When enumerating the source directory seeking migration files, `sqlx`
ignores entries that aren't files. This was previously reported as #614
and fixed in #985 but apparently regressed somewhere along the way. This
commit reintroduces the fix from #985 to the current implementation: use
`std::fs::metadata` instead of `std::fs::DirEntry::metadata`. The former
is documented to traverse symlinks; the latter does not.
* add migrations_symlink test
* Add failing tests
* remove unnecessary functions, clarify function names
* simplify access to cursor columns with helper methods
* split table info from cursor info so that cursors can share table info
* fix test expectations
* add basic describe benchmarks
* separate memory from query state
* move branch tracking & deduplication logic into a dedicated BranchList class
* Convert to using IntMap
* move intmap to a separate module, drop dead code, clean up function names
* Update Cargo.lock
* skip branches to check foreign keys, as they generally shouldn't impact query result type
If the first test thread is a bit slow after it acquires the
`DO_CLEANUP` permit, it can accidentally delete a fresh test db created
by another thread right before that other thread has a chance to open
its connection.
This fix simply records the current timestamp _before_ we acquire the
`DO_CLEANUP` permit and only cleans up test db's created before then.
SQLite's CURRENT_TIMESTAMP keyword fills a DATETIME column as a UTC expressed
string in the following format: "YYYY-MM-DD HH:MM:SS".
Unfortunately, this format lacks the timezone information to safely build
a time::OffsetDateTime.
If all else fails, this patch will try to build it by assuming the missing
timezine is UTC.
chrono 0.4's default features include the `oldtime` feature which pulls in time 0.1.44.
This is an unmaintained version with soundness issues (time-rs/time#293) and is rarely needed.
If downstream users require this dependency, they can enable the feature themselves.