Commit graph

110 commits

Author SHA1 Message Date
Austin Bonander
b6cddcd014
prepare 0.6.2 release (#2092) 2022-09-14 15:23:06 -07:00
Travis Whitehead
09717e1b83
fix: Remove default chrono dep on time for sqlx-cli (#2089)
chrono v0.4.19 includes time 0.1 via default feature flag oldtime.
time 0.1 is deprecated and flagged for: https://rustsec.org/advisories/RUSTSEC-2020-0071
2022-09-12 18:08:39 -07:00
cycraig
20af5cd9c3
Use cargo check consistently in prepare (#2071) 2022-08-31 17:02:46 -07:00
cycraig
0823e1139c
Fix prepare race condition in workspaces (#2069)
* Separate offline query metadata per crate

* Update sqlx-cli prepare to use separate query metadata per crate

* Add resolve.root to metadata test fixture

* Simplify root package resolution

* Fix prepare --merged
2022-08-26 17:30:09 -07:00
Austin Bonander
cb52c7c62b chore: prep 0.6.1 release 2022-08-02 19:16:32 -07:00
Austin Bonander
a2eceec33b
chore: replace dotenv with dotenvy (#2003)
* chore: replace `dotenv` with `dotenvy`

The former appears to be unmaintained and the latter is a drop-in replacement.

* chore: fix all warnings
2022-07-28 14:33:44 -07:00
Ivan Kozik
b9a8f90b0c
fix(sqlx-cli): fix the build (#1969)
This fixes:

```
error[E0616]: field `target_directory` of struct `metadata::Metadata` is private
   --> sqlx-cli/src/prepare.rs:175:47
    |
175 |             .env("CARGO_TARGET_DIR", metadata.target_directory.clone())
    |                                               ^^^^^^^^^^^^^^^^ private field
    |
help: a method `target_directory` also exists, call it with parentheses
    |
175 |             .env("CARGO_TARGET_DIR", metadata.target_directory().clone())
    |                                                               ++
```
2022-07-14 00:09:53 -07:00
Fredrik Park
7d8ded9a1a
Set CARGO_TARGET_DIR when compiling the prepare queries (#1910)
* Move compiled query data

I did try to set rustc's --out-dir but encountered a strange error
stating that it can not be set more than once (even though I am unable
to deduce what else is setting it).

This enabled me to set a custom CARGO_TARGET_DIR and still be able to
prepare queries.

* Set CARGO_TARGET_DIR in the rustc invocation
2022-07-12 17:25:52 -07:00
LovecraftianHorror
2c67e2a29e
Try avoiding a full clean in cargo sqlx prepare --merged (#1802)
* refactor(sqlx-cli): Try avoiding a full clean with `--merged`

* docs(sqlx-cli): Sprinkle some comments on the metadata changes

* refactor(sqlx-cli): Make the new recompiltion setup unit-testable

* fix(sqlx-cli): Only pass in `$RUSTFLAGS` when set when using `--merged`

* refactor(sqlx-cli): `cargo clean -p` works by name so rip out pkgid code

* chore(sqlx-cli): Remove unused imports
2022-07-12 14:29:41 -07:00
Austin Bonander
bc3e70545b
sqlite improvements (#1965)
* 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
2022-07-12 13:59:37 -07:00
Austin Bonander
17cebde64a
preparing 0.6.0 release (#1911)
* preparing 0.6.0 release

* run `cargo update` (not `upgrade`)
2022-06-16 15:53:09 -07:00
Miklós Tusz
664d576655
Fix migration checksum comparison during migrate info (#1888)
When running `sqlx migrate info`, the applied migrations checksums are
compared against the checksums of the local migration files. While the
checksums of applied migrations are stored correctly in the database as
sha384sum values, the `migrate info` command was incorrectly comparing
these against the checksums of down-migrations in cases where reversible
migrations are being used (e.g. when migrations end in `.up.sql` and
`.down.sql`).

This fixes the issue by skipping over any migrations with the
`MigrationType::ReversibleDown` type, using the same idiom as is used
when running migrations (with `migrate run`).

Issue introduced in #1680
Partially resolves #1158
2022-06-10 12:07:23 -07:00
Austin Bonander
1f91724927
feat(cli): add --connect-timeout (#1889) 2022-06-08 15:48:04 -07:00
Kian-Meng Ang
d52f301a94
Fix typos (#1894)
* Fix typos

* Update CHANGELOG.md

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

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2022-06-08 14:56:56 -07:00
Toby Murray
24baac779f
Put Usage at same level as Install (#1814)
From a formatting perspective, `Usage` is currently nested under `Install`. I think these would appropriately be siblings. This has the side benefit of making the headings under `Usage` more visually distinct from the rest of the content which I think makes it easier to read.
2022-06-01 13:53:47 -07:00
Toby Murray
302b415897
Reword "building in offline mode" (#1815)
Sometimes people do a bad job of reading comprehension (see #1813). This rewords a little to be even more prescriptive about how to build in offline mode.
2022-05-31 16:59:37 -07:00
Paolo Barbolini
b934f82440
Bump remanining dependencies (#1807)
Co-authored-by: Austin Bonander <austin@launchbadge.com>
2022-04-15 14:34:48 -07:00
Paolo Barbolini
fc9c9be5e8
Update to edition 2021 (#1808)
* Update to edition 2021

* Fix running tests
2022-04-15 12:52:00 -07:00
Austin Bonander
2e026cae67
prepare 0.5.12 release (#1800)
* prepare release 0.5.12

* chore: remove mentions of things happening in 0.6

except one mention that should still be happening in 0.6
2022-04-14 14:21:15 -07:00
Pedro de Matos Fedricci
c30a4a5d88
Add --source for migration subcommands (#1769) 2022-04-01 12:19:51 -07:00
LovecraftianHorror
feff96c460
fix(sqlx-cli): pass the DATABASE_URL to command spawned for sqlx-macros (#1735) 2022-03-09 10:24:00 -06:00
Austin Bonander
eaf41fd092
prepare 0.5.11 release (#1715) 2022-02-18 13:49:06 -08:00
Fredrik Park
e7a50d3501
Document Offline mode with feature flags (#1665)
I ran into this and found the solution inside of this issue https://github.com/launchbadge/sqlx/issues/1593
Fixes #1593
2022-02-15 21:14:04 -08:00
Marcin Puc
313cc69988
Simplify cargo-sqlx cmdline definition (#1626)
* Simplify cargo-sqlx cmdline definition

* Add note about the parser definition for cargo-sqlx

* Fix formatting
2022-02-15 20:13:42 -08:00
Liam
7fb54d3d7b
Add checksum mismtaches to sqlx-cli migrate info (#1680)
This fixes #870
2022-02-15 20:11:06 -08:00
Austin Bonander
8e46e17ce0
docs: fix install instructions for sqlx-cli 2022-01-03 13:32:58 -08:00
Austin Bonander
fdbfc5dfc3
Prepare 0.5.10 release (#1603)
* fix(cli): change new `rustls` and `native-tls` features to use correct runtime feature

* chore: upgrade SQLx crates to 0.5.10, upgrade all dependencies to latest versions

chore(cli): upgraded `clap` to `3.0.0-rc.9`

* fix(tests/sqlite): ignore `issue_1467()` as spuriously failing

I'm well aware of the principle that a spuriously failing test is a failing test, but even though I have it outputting the seed used with a reproducible PRNG, I can't reproduce the failures locally, so 🤷.

* chore: add CHANGELOG entry for 0.5.10
2021-12-29 17:25:49 -08:00
SonicZentropy
aa40f5fe5d
[CLI] Adds feature enabling Rustls usage rather than OpenSSL (#1584)
* Adds feature enabling Rustls usage rather than OpenSSL

* Update sqlx-cli/Cargo.toml

Removes extraneous openssl feature that slipped through

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

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
2021-12-29 15:49:49 -08:00
Thomas Kintscher
f0d0f2f2e9
Append to existing RUSTFLAGS, instead of overwriting. (#1582)
* Append to existing RUSTFLAGS, instead of overwriting.

* Assemble RUSTFLAGS correctly.

Co-authored-by: Thomas Kintscher <thomas@flowciety.de>
2021-12-20 19:12:58 -08:00
Austin Bonander
c8db803dca
fix(sqlx-cli/readme): mention openssl-vendored 2021-11-09 18:02:32 -08:00
Austin Bonander
9abe9b3ac5
prepare 0.5.9 hotfix release (#1469) 2021-10-01 15:52:52 -07:00
Austin Bonander
1b5dd6514b
preparing 0.5.8 release (#1466)
* preparing 0.5.8 release

* fix warnings before release
2021-10-01 14:45:25 -07:00
Erik
efde5c507f
Add reverting instructions to README (#1468)
Instructions on reverting migrations are missing from the README. Here are some that others may find helpful.
2021-10-01 13:44:48 -07:00
David James
bb33a296cb
Fix issue #1431 (#1432)
Why: dotenv() must execute before clap's get_matches()

Co-authored-by: David James <davidcjames@gmail.com>
2021-09-10 15:06:49 -07:00
David James
ad81e35f28
Use promptly instead of dialoguer (#1410)
See #1409

Co-authored-by: David James <davidcjames@gmail.com>
2021-08-30 14:10:53 -07:00
Evan Cameron
0e51272b72
fix(cli) move database_url #1391 (#1400) 2021-08-30 14:10:01 -07:00
Austin Bonander
3749e0ea37
chore: prepare 0.5.7 (hotfix) release (#1394) 2021-08-20 17:14:42 -07:00
Austin Bonander
207e6db2ce
chore: bump versions of sqlx-* in dependencies 2021-08-17 12:49:02 -07:00
Austin Bonander
6bb1c716bd
preparing 0.5.6 release (#1382)
* fix(pool): reenable connection reaper

* fix warnings

* chore: bump published crates to 0.5.6

* chore: update CHANGELOG.md for 0.5.6
2021-08-17 12:44:24 -07:00
Austin Bonander
38435ca647
fix(cli): pin clap_derive version (#1381)
When `clap_derive 3.0.0-beta.4` released, new invocations of `cargo install sqlx-cli` would try to compile that against `clap 3.0.0-beta.2` which caused some breakages.

Until `clap 3.0.0` proper is released, we need to pin both versions to insure against potential breakages from automatic upgrades.

closes #1378
2021-08-16 16:51:31 -07:00
Austin Bonander
e89cb0971a
fix(macros): tell the compiler about external files/env vars to watch (#1332)
* fix(macros): tell the compiler about external files/env vars to watch

closes #663
closes #681

* feat(cli): add `migrate` subcommand for generating a build script

suggest embedding migrations on `sqlx migrate add` in a new project
2021-07-21 16:36:22 -07:00
Jonas Platte
4986ea2e59
Improve root README.md and sqlx-cli/README.md (#1262)
* readme: Fix inconsistent list style

* readme: Improve text alignment

* readme: Fix missing links

* readme: Consistently use code formatting for runtime & TLS crates and dedup links

* readme: Add SQLx is not an ORM section

* readme: Improve documentation about offline mode
2021-05-30 15:52:25 -07:00
Ryan Leckey
694a2ac478 release: v0.5.5 2021-05-24 09:34:34 -07:00
Ryan Leckey
5d9c292132 release: v0.5.4 2021-05-22 16:38:54 -07:00
Ryan Leckey
13f7c7124a release: v0.5.3 2021-05-21 17:27:15 -07:00
Kitsu
be88631b5e Remove redundant args default notice 2021-04-27 12:35:46 -07:00
Stephen W
212d235334
Try to make 'no queries found' message more clear (#1191)
* try to make 'no queries found' message more clear

* Be more polite
2021-04-26 00:40:33 -07:00
Ryan Leckey
f7775f7fde release: 0.5.2 2021-04-15 18:40:46 -07:00
Ryan Leckey
633a662752 chore: update dependencies 2021-04-09 00:31:07 -07:00
Benjamin Bäumler
fc6eb6363b sqlx-cli database reset fix confirmation flag
sqlx database reset currenctly requires no confirmation and a
confirmation when -y flag is set. Should be the other way around
as it is for sqlx database drop. This commit fixes this.
2021-04-09 00:12:27 -07:00