Commit graph

2386 commits

Author SHA1 Message Date
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
vizvasrj
200e17bb04
in README.md, correct spelling and grammar (#2453)
* in README.md, correct spelling and grammar

* Update README.md

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

* Update README.md

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

* Update README.md

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

* Update README.md

missing article (the) in line 274

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2023-05-04 12:59:35 -07:00
Luiz Carvalho
4095ac44ae
chore: add deprecation notice for type ascription use (#2483)
* chore: add deprecation notice for type ascription use

* docs: type ascription deprecation
2023-05-04 12:58:57 -07:00
tyrelr
39acaf1459
limit the number of instructions that can be evaluated (#2459)
* limit the number of instructions that can be evaluated

* code cleanup
2023-05-04 11:46:11 -07:00
Nicolas Stinus
dc9e298bff
fix(sqlx-core): allow time::OffsetDateTime to be built from sqlite's CURRENT_TIMESTAMP (#2285)
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.
2023-05-01 15:05:40 -07:00
Nisheeth Barthwal
4f1ac1d606
add progress handler support to sqlite (#2256)
* rebase main

* fmt

* use NonNull to fix UB

* apply code suggestions

* add test for multiple handler drops

* remove nightly features for test
2023-03-24 14:27:16 -07:00
Paolo Barbolini
14d70feab1 Enable runtime-tokio of sqlx when building sqlx-cli 2023-03-24 00:28:16 -07:00
patix
9ac2cb3ace fix(macros-core): use of undeclared tracked_path 2023-03-20 14:12:41 -07:00
Alexander Lyon
bd3eb94737 fix(#2407): respect the HaltIfNull opcode when determining nullability 2023-03-20 14:12:20 -07:00
Austin Bonander
15458fa9d6
fix: update docs.rs features metadata 2023-03-16 17:11:46 -07:00
Austin Bonander
ec60b1d32d fix: replace use of deprecated chrono APIs 2023-03-16 17:03:14 -07:00
Austin Bonander
0f6c377c12 fix: replace use of deprecated base64 functions 2023-03-16 17:03:14 -07:00
Austin Bonander
d43257e18a chore: cleanup, fix all non-deprecation warnings 2023-03-16 17:03:14 -07:00
Austin Bonander
aa6c6d9752 fix(docs): update README for 0.7.0, note alpha cycle 2023-03-16 17:03:14 -07:00
df51d
a622f044ef fix(docs): example of sqlx_macros_unstable in config.toml 2023-03-16 17:03:14 -07:00
Austin Bonander
551d622cc1 0.7.0-alpha.2 release 2023-03-16 17:03:14 -07:00
Coda Hale
bce16a5c1d fix: drop old time 0.1.44 dep
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.
2023-03-14 18:07:52 -07:00
Austin Schey
cf3ce13d27 fix(prepare): store temporary query files inside the workspace 2023-03-14 17:25:24 -07:00
Gregor Giesen
70934d7cd2 Docs of FromRow -> skip attribute updated as suggested by @abonander
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2023-03-13 18:06:44 -07:00
Gregor Giesen
6713e8cdaa Docs for skip attribute of FromRow macro 2023-03-13 18:06:44 -07:00
Gregor Giesen
cc91986a42 fixed cargo format check 2023-03-13 18:06:44 -07:00
Gregor Giesen
03de69bcaa test for FromRow -> skip attribute 2023-03-13 18:06:44 -07:00