Commit graph

2257 commits

Author SHA1 Message Date
Sebastian N. Fernandez
7e7dded8af
Adding PgHasArrayType for &[u8;N] (#2634)
* Adding PgHasArrayType for &[u8;N]

* cargo fmt

---------

Co-authored-by: asdf <asdf@ethereum>
2023-07-24 16:10:42 -07:00
Sebastian
eae9484710
typo: BYTE -> BINARY (#2624)
MySQL does not have a BYTE type.
2023-07-24 16:09:22 -07:00
Joakim Malmberg
8cad54cc9f
Add postgres chat exmaple (#2577)
Co-authored-by: Stephen <webmaster@scd31.com>
2023-07-24 16:09:06 -07:00
Marcus Pettersen Irgens
b066af6b17
0.7 is stable (#2628)
Looks like the note one one of the examples was left out when updating the README.
2023-07-24 16:07:37 -07:00
Jesse Wang
94379d88b3
fix(postgres): fix buffer management in PgCopyIn.read_from (#2630) 2023-07-24 16:07:29 -07:00
Max Vorobev
f2bb464bcd
Support naming migrations sequentially (#2602)
* Support naming migrations sequentially and inferring naming scheme

* Document new options and how naming is inferred

* Only account for up migrations when inferring ordering
2023-07-24 16:00:26 -07:00
Austin Bonander
c70cfaf035
prepare 0.7.1 release (#2621) 2023-07-14 17:24:52 -07:00
Johannes
f7ce8fd9f4
Implement Default for QueryBuilder (#2605) 2023-07-14 16:28:14 -07:00
Luiz Carvalho
3662bdab84
fix(sqlite): encode bool as integer (#2620) 2023-07-14 16:27:53 -07:00
Austin Bonander
1d1095e94f
feat: allow opt-out of PgHasArrayType with #[derive(sqlx::Type)] (#2619)
closes #2611
2023-07-14 16:16:18 -07:00
Vabka
3268698f2e
Update README.md (#2613)
Actually there is `rust_decimal` feature,  not just `decimal`
2023-07-14 12:30:11 -07:00
Jakub Kołodziejczak
66436565e8
docs(changelog): be more verbose about offline mode breaking change (#2603) 2023-07-14 10:43:03 -07:00
Quang Le
74370f7ef0
Introduce build_query_scalar for QueryBuilder (#2551) 2023-07-14 10:42:19 -07:00
Simon Menke
aee0e18b0b
Remove incorrect CAST in test database cleanup for MySQL. (#2599)
* Remove incorrect CAST in test daatbase cleanup for MySQL.

* Not sure how this ever really worked.
2023-07-14 10:38:12 -07:00
Luiz Carvalho
3db16751a0
feat(sqlx-core): add table function to database error (#2616) 2023-07-14 10:37:02 -07:00
Jonathan Newnham
afb6b1066e
improve docs about migration files (#2566) 2023-07-10 14:36:05 -07:00
Austin Bonander
56ccdd294b
fix(CHANGELOG): mention AnyEncode removal
closes #2598
2023-07-10 12:34:26 -07:00
Andrew Lilley Brinker
f06c4c27ce
Implement Clone for PoolOptions manually (#2548) (#2553)
* 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
2023-07-09 14:34:31 -07:00
Jon Heinritz
8b223e24d3
Update clap to v4.3.10 (#2576) 2023-07-09 13:13:43 -07:00
Dennis Schubert
b283a31e4b
Correct mention of the tls-native-tls in the documentation. (#2593) 2023-07-08 12:42:50 -07:00
Paolo Barbolini
a87a871913
Bump webpki-roots to v0.24 (#2597) 2023-07-08 12:42:32 -07:00
Jack DeNeut
258eacafd9
Fix for Issue #2549 - cannot use feature "rust_decimal" without also using "bigdecimal" (#2585)
* Fix missing num-bigint dependency for rust_decimal

* Fix missing feature name change from "decimal" to "rust_decimal"

* update missing "decimal"->"rust_decimal" renaming in range.rs

* Update money.rs references to "decimal"

* Update "decimal" -> "rust_decimal"
2023-07-06 16:02:47 -07:00
saolof
016884454b
Update README.md now that 0.7.0 is no longer in alpha (#2580)
* Update README.md

0.7.0 is now released on crates.io

* Update README.md

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2023-07-06 16:01:37 -07:00
kitterion
310af5c2c8
Fix optional dependency on sqlx-macros (#2586) 2023-07-06 16:01:21 -07:00
Austin Bonander
af67b136cd
fix(CHANGELOG): copy breaking changes list from #2039 2023-07-03 15:34:45 -07:00
Austin Bonander
dcb58b0e2c
0.7.0 release (#2575)
* WIP preparing 0.7.0 release

* fix: re-enable examples

* fix doctests in `sqlx-core`

* cherry-pick CHANGELOG entry for 0.6.3

* add actions workflow for examples

* fix(cli): close connection after running migrations

* fix examples

* fix(sqlite): fix parsing of URLs via `Any`

* fix(example): don't let Postgres `listen` example run forever

* fix Postgres `transaction` example
2023-07-03 14:37:37 -07:00
Andrew Lilley Brinker
1bdbedabdc
Impl AsMut for advisory lock types (#2520) (#2554)
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
2023-06-30 16:53:14 -07:00
Austin Bonander
e2ce463af8
doc: make it clear that ConnectOptions types impl FromStr (#2574) 2023-06-30 16:49:24 -07:00
Andrew Whitehead
3fbc3a3ff2
(sqlite) do not drop notify mutex until after condvar is triggered (#2573)
Signed-off-by: Andrew Whitehead <cywolf@gmail.com>
2023-06-30 16:48:52 -07:00
Jon Heinritz
1b7631eddc
Add CLI autocompletion using clap_complete (#2559) 2023-06-30 14:59:35 -07:00
Elliot Speck
4b254ea1cb
sqlite date macro support (#2491)
* 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.
2023-06-30 14:56:32 -07:00
Iban Eguia Moraza
87ff6457b9
Exposing the Oid of PostgreSQL types (#2507)
* 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>
2023-06-30 14:35:42 -07:00
Bastian
c2e54eae6f
add args to query builder (#2494) (#2506)
* add args to query builder (#2494)

* add test

* Update sqlx-core/src/query_builder.rs

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>

* fmt

---------

Co-authored-by: Bastian Schubert <bastian.schubert@dock.financial>
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2023-06-30 14:26:25 -07:00
Stepan Tubanov
3fdb79d03c
Do not panic when PrepareOk fails to decode (#2572) 2023-06-30 14:14:37 -07:00
Paolo Barbolini
8c7f541324
Update rsa to 0.9 (#2563) 2023-06-30 14:10:02 -07:00
Yuri Astrakhan
ab3a8e8456
Add a newline to the generated JSON files (#2570)
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.
2023-06-30 13:18:56 -07:00
Jon Heinritz
815ed7ddf6
Fix broken links to mysql documentation (#2569) 2023-06-30 13:18:47 -07:00
Paolo Barbolini
37fdc2043b
Update bitflags to v2 (#2564) 2023-06-30 12:34:33 -07:00
Paolo Barbolini
713da5b7b0
Bump indexmap and ahash (#2565) 2023-06-30 12:32:46 -07:00
Tim Geoghegan
0c8fe729ff
Traverse symlinks when resolving migrations (#2445)
* 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
2023-06-13 11:21:09 -07:00
tyrelr
238a95b0f3
Sqlite analytical (#2508)
* 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
2023-06-12 12:48:32 -07:00
Wesley Norris
d750f28ef0
Bump mac_address to 1.1.5 (#2515) 2023-06-12 12:44:55 -07:00
Southball
de90a55253
Use ::std::result::Result::Ok in output.rs (#2519) 2023-06-12 12:44:37 -07:00
Austin Bonander
253d8c9f69
0.7.0-alpha.3 release 2023-05-11 16:49:24 -07:00
Mauro D
af0f04a108
Bump to libsqlite3-sys 0.26 (#2496) 2023-05-11 15:43:52 -07:00
Sergio Benitez
8f4063c511
Update rustls to 0.21, webpki-roots to 0.23 (#2440) 2023-05-11 15:19:24 -07:00
tyrelr
0dfebb202f
Add and improve sqlite describe performance benchmarks (#2467)
* 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
2023-05-08 12:44:28 -07:00
Philip Kannegaard Hayes
1227d5d168
fix: ensure fresh test db's aren't accidentally deleted by do_cleanup (#2454)
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.
2023-05-04 13:23:04 -07:00
Midas Lambrichts
cbf8dd37e9
Add Simple format for Uuid for MySQL & SQLite. (#2469)
* Add Simple format for Uuid for MySQL & SQLite.

Copy pasted the implementation for `Hyphenated` and adapt.

* Add uuid Simple docs for SQLite
2023-05-04 13:14:06 -07:00
Utkarsh Gupta
003878698e
chore(sqlx-postgres): replace dirs with home & etcetera (#2485) 2023-05-04 13:12:54 -07:00