Commit graph

26 commits

Author SHA1 Message Date
kshramt
b4269b7c86
Support query! for cargo-free systems (#2927)
Co-authored-by: kshramt <kshramt@example.com>
2024-01-17 19:15:22 -08:00
Roberto Ripamonti
16eeea8611
Add fixtures_path in sqlx::test args (#2545)
* feat: add fixtures_path

* test: add test for fixtures_path

* docs: expand test docs with fixtures_path

* test: add new test instead of co-opting and old one.

* feat: add explicit path operating mode for fixtures parameters and allow combining multiple fixtures parameters

* fix: require .sql extension for explicit path fixtures

* feat: add custom relative path style to fixtures argument

* fix: missing cfg feature

* docs: update

* fix: explicit fixtures styling checks for paths. Remove strict sql extension requirement for explicit path, they still need an extension. Add .sql extension to implicit fixtures style only if missing.

* style: cargo fmt

* docs: update documentation
2023-11-15 16:08:24 -08:00
Yuri Astrakhan
ee3b94d726
Prevent warnings running cargo build (#2856)
When none of the features is enabled (default features), prevent compiler warnings.
2023-11-06 12:47:47 -08:00
Nemo157
080d57af3a
Customize the macro error message based on offline status (#2769) 2023-10-17 16:25:09 -07:00
Gregor Giesen
54c5d6bc3c
derive FromRow: sqlx(default) for all fields (#2801)
* derive FromRow: sqlx(default) for all fields

* error in test_struct_default fixed

* derive FromRow: struct level sqlx(default) requires and uses Default implementation

* Update sqlx-core/src/from_row.rs

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

* Update sqlx-core/src/from_row.rs

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

* satify cargo fmt

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2023-10-17 16:13:40 -07:00
Matt Fellenz
b16fbebf2f
Don't use separate temp dir for query jsons (2) (#2803)
* Don't use temp dir for query jsons

Fixes #2663

* Return early when exclusive create fails

* Use atomic-file-write for writing query data
2023-10-17 11:41:30 -07:00
kryptan
ca608a964e
Clarify where optional features should be enabled (#2706) 2023-09-21 17:49:51 -07:00
Yuri Astrakhan
a8a0579713
Treat warnings as errors on CI builds (#2651) 2023-07-31 13:29:07 -07:00
Yuri Astrakhan
a824e8468c
Cleanup format arguments (#2650)
Inlined format args make code more readable, and code more compact.

I ran this clippy command to fix most cases, and then cleaned up a few trailing commas and uncaught edge cases.

```
cargo clippy --bins --examples  --benches --tests --lib --workspace --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2023-07-31 13:27:04 -07:00
Marco Cameriero
9463b7592f
Add JSON support to FromRow derive (#2121)
* Add `json` attribute to `FromRow` derive

* Add docs and fix formatting
2023-07-31 12:52:42 -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
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
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
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
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
Southball
de90a55253
Use ::std::result::Result::Ok in output.rs (#2519) 2023-06-12 12:44:37 -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
patix
9ac2cb3ace fix(macros-core): use of undeclared tracked_path 2023-03-20 14:12:41 -07:00
Austin Bonander
d43257e18a chore: cleanup, fix all non-deprecation warnings 2023-03-16 17:03:14 -07:00
Austin Schey
cf3ce13d27 fix(prepare): store temporary query files inside the workspace 2023-03-14 17:25:24 -07:00
Gregor Giesen
665b859645 derive FromRow: added attribute skip for setting default value 2023-03-13 18:06:44 -07:00
Vladimir
4b8fa7a4d7 feat: support new types in sqlx::query_as! 2023-03-08 18:55:53 -08:00
Craig Bester
96c8b12485 feat(prepare): move to one-file-per-query for offline mode
Co-authored-by: Jonas Platte <jonas@lumeo.com>
2023-03-01 19:17:21 -08:00
Austin Bonander
eade49cfb0
0.7.0-alpha.1 release 2023-02-21 14:56:54 -08:00
Marco Cameriero
9f1f682285 Allow using complex types in try_from when deriving FromRow (#2115)
* Use `syn::Type` instead of `syn::Ident` to parse the value of `#[sqlx(try_from = "...")]`

* Fix broken test after rebase
2023-02-21 13:25:25 -08:00
Austin Bonander
b5312c3b6f Break drivers out into separate crates, clean up some technical debt (#2039)
* WIP rt refactors

* refactor: break drivers out into separate crates

also cleans up significant technical debt
2023-02-21 13:25:25 -08:00