Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
9305b3c
feat: create `sqlx.toml` format
abonander Jul 26, 2024
c0ad151
feat: add support for ignored_chars config to sqlx_core::migrate
abonander Sep 9, 2024
f6f0c75
chore: test ignored_chars with `U+FEFF` (ZWNBSP/BOM)
abonander Sep 9, 2024
510d3e2
refactor: make `Config` always compiled
abonander Sep 18, 2024
de8035b
refactor: add origin information to `Column`
abonander Sep 18, 2024
f5493fd
feat(macros): implement `type_override` and `column_override` from `s…
abonander Sep 19, 2024
427e82c
refactor(sqlx.toml): make all keys kebab-case, create `macros.preferr…
abonander Sep 20, 2024
74ab3a9
feat: make macros aware of `macros.preferred-crates`
abonander Sep 20, 2024
901b839
feat: make `sqlx-cli` aware of `database-url-var`
abonander Sep 20, 2024
5fefa80
feat: teach macros about `migrate.table-name`, `migrations-dir`
abonander Sep 23, 2024
65eb133
feat: teach macros about `migrate.ignored-chars`
abonander Sep 23, 2024
9fe3780
chore: delete unused source file `sqlx-cli/src/migration.rs`
abonander Oct 5, 2024
a32b0c0
feat: teach `sqlx-cli` about `migrate.defaults`
abonander Oct 5, 2024
1a1975d
feat: teach `sqlx-cli` about `migrate.migrations-dir`
abonander Jan 15, 2025
f6d0dce
feat: teach `sqlx-cli` about `migrate.table-name`
abonander Jan 22, 2025
04b2093
feat: introduce `migrate.create-schemas`
abonander Jan 22, 2025
d38d567
WIP feat: create multi-tenant database example
abonander Jan 26, 2025
45fb170
fix(postgres): don't fetch `ColumnOrigin` for transparently-prepared …
abonander Feb 2, 2025
f859b7f
feat: progress on axum-multi-tenant example
abonander Feb 2, 2025
7dfc1a4
feat(config): better errors for mislabeled fields
abonander Feb 21, 2025
13f6957
WIP feat: filling out axum-multi-tenant example
abonander Feb 26, 2025
f5f2f07
feat: multi-tenant example
abonander Feb 28, 2025
c62e83a
chore(ci): test multi-tenant example
abonander Feb 28, 2025
edc0922
fixup after merge
abonander Feb 28, 2025
5b92990
fix(ci): enable `sqlx-toml` in CLI build for examples
abonander Feb 28, 2025
518a651
fix: CI, README for `multi-tenant`
abonander Feb 28, 2025
783030e
fix: clippy warnings
abonander Feb 28, 2025
24b8e5d
fix: multi-tenant README
abonander Feb 28, 2025
b097ba3
fix: sequential versioning inference for migrations
abonander Feb 28, 2025
3504a80
fix: migration versioning with explicit overrides
abonander Feb 28, 2025
1ab5b86
fix: only warn on ambiguous crates if the invocation relies on it
abonander Mar 30, 2025
2d25be6
fix: remove unused imports
abonander Mar 30, 2025
5ae02d6
fix: doctest
abonander Mar 31, 2025
8fac8d8
fix: `sqlx mig add` behavior and tests
abonander Mar 31, 2025
722147a
fix: restore original type-checking order
abonander Mar 31, 2025
8e9998d
fix: deprecation warning in `tests/postgres/macros.rs`
abonander Mar 31, 2025
c417645
feat: create postgres/multi-database example
abonander Apr 11, 2025
1ab2dae
fix: examples/postgres/multi-database
abonander Apr 13, 2025
dfd58c2
fix: cargo fmt
abonander Apr 13, 2025
1fb5b7d
chore: add tests for config `migrate.defaults`
abonander May 3, 2025
de5b7fa
fix: sqlx-cli/tests/add.rs
abonander May 3, 2025
ed4d223
feat(cli): add `--config` override to all relevant commands
abonander May 3, 2025
e9ef042
chore: run `sqlx mig add` test with `RUST_BACKTRACE=1`
abonander May 3, 2025
832085d
fix: properly canonicalize config path for `sqlx mig add` test
abonander May 3, 2025
c7b5e6e
fix: get `sqlx mig add` test passing
abonander May 3, 2025
5b19bd7
fix(cli): test `migrate.ignored-chars`, fix bugs
abonander May 16, 2025
682ed55
feat: create `macros.preferred-crates` example
abonander Jun 2, 2025
594febe
fix(examples): use workspace `sqlx`
abonander Jun 2, 2025
d79aab1
fix: examples
abonander Jun 2, 2025
9918642
fix(sqlite): unexpected feature flags in `type_checking.rs`
abonander Jun 2, 2025
0344191
fix: run `cargo fmt`
abonander Jun 2, 2025
1fafbed
fix: more example fixes
abonander Jun 2, 2025
45f3a17
fix(ci): preferred-crates setup
abonander Jun 2, 2025
38549ca
fix(examples): enable default-features for workspace `sqlx`
abonander Jun 2, 2025
003cb31
fix(examples): issues in `preferred-crates`
abonander Jun 2, 2025
70bc1d4
chore: adjust error message for missing param type in `query!()`
abonander Jun 3, 2025
5c081e0
doc: mention new `sqlx.toml` configuration
abonander Jun 3, 2025
3c5a35e
chore: add `CHANGELOG` entry
abonander Jun 4, 2025
51079bf
doc: fix new example titles
abonander Jun 4, 2025
bcbade6
refactor: make `sqlx-toml` feature non-default, improve errors
abonander Jun 5, 2025
8611cc2
refactor: eliminate panics in `Config` read path
abonander Jun 5, 2025
de4e2fc
chore: remove unused `axum` dependency from new examples
abonander Jun 5, 2025
fc206e1
fix(config): restore fallback to default config for macros
abonander Jun 30, 2025
243d810
chore(config): remove use of `once_cell` (to match `main`)
abonander Jun 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 44 additions & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
--bin sqlx
--release
--no-default-features
--features mysql,postgres,sqlite
--features mysql,postgres,sqlite,sqlx-toml

- uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -175,6 +175,49 @@ jobs:
DATABASE_URL: postgres://postgres:password@localhost:5432/mockable-todos
run: cargo run -p sqlx-example-postgres-mockable-todos

- name: Multi-Database (Setup)
working-directory: examples/postgres/multi-database
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/multi-database
ACCOUNTS_DATABASE_URL: postgres://postgres:password@localhost:5432/multi-database-accounts
PAYMENTS_DATABASE_URL: postgres://postgres:password@localhost:5432/multi-database-payments
run: |
(cd accounts && sqlx db setup)
(cd payments && sqlx db setup)
sqlx db setup

- name: Multi-Database (Run)
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/multi-database
ACCOUNTS_DATABASE_URL: postgres://postgres:password@localhost:5432/multi-database-accounts
PAYMENTS_DATABASE_URL: postgres://postgres:password@localhost:5432/multi-database-payments
run: cargo run -p sqlx-example-postgres-multi-database

- name: Multi-Tenant (Setup)
working-directory: examples/postgres/multi-tenant
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/multi-tenant
run: |
(cd accounts && sqlx db setup)
(cd payments && sqlx migrate run)
sqlx migrate run

- name: Multi-Tenant (Run)
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/multi-tenant
run: cargo run -p sqlx-example-postgres-multi-tenant

- name: Preferred-Crates (Setup)
working-directory: examples/postgres/preferred-crates
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/preferred-crates
run: sqlx db setup

- name: Multi-Tenant (Run)
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/preferred-crates
run: cargo run -p sqlx-example-postgres-preferred-crates

- name: TODOs (Setup)
working-directory: examples/postgres/todos
env:
Expand Down
32 changes: 29 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,42 @@ This section will be replaced in subsequent alpha releases. See the Git history

### Breaking

* [[#3821]] Groundwork for 0.9.0-alpha.1
* Increased MSRV to 1.86 and set rust-version [@abonander]
* [[#3821]]: Groundwork for 0.9.0-alpha.1 [[@abonander]]
* Increased MSRV to 1.86 and set rust-version
* Deleted deprecated combination runtime+TLS features (e.g. `runtime-tokio-native-tls`)
* Deleted re-export of unstable `TransactionManager` trait in `sqlx`.
* Not technically a breaking change because it's `#[doc(hidden)]`,
but [it _will_ break SeaORM][seaorm-2600] if not proactively fixed.
* [[#3383]]: feat: create `sqlx.toml` format [[@abonander]]
* SQLx and `sqlx-cli` now support per-crate configuration files (`sqlx.toml`)
* New functionality includes, but is not limited to:
* Rename `DATABASE_URL` for a crate (for multi-database workspaces)
* Set global type overrides for the macros (supporting custom types)
* Rename or relocate the `_sqlx_migrations` table (for multiple crates using the same database)
* Set characters to ignore when hashing migrations (e.g. ignore whitespace)
* More to be implemented in future releases.
* Enable feature `sqlx-toml` to use.
* `sqlx-cli` has it enabled by default, but `sqlx` does **not**.
* Default features of library crates can be hard to completely turn off because of [feature unification],
so it's better to keep the default feature set as limited as possible.
[This is something we learned the hard way.][preferred-crates]
* Guide: see `sqlx::_config` module in documentation.
* Reference: [[Link](sqlx-core/src/config/reference.toml)]
* Examples (written for Postgres but can be adapted to other databases; PRs welcome!):
* Multiple databases using `DATABASE_URL` renaming and global type overrides: [[Link](examples/postgres/multi-database)]
* Multi-tenant database using `_sqlx_migrations` renaming and multiple schemas: [[Link](examples/postgres/multi-tenant)]
* Force use of `chrono` when `time` is enabled (e.g. when using `tower-sessions-sqlx-store`): [[Link][preferred-crates]]
* Forcing `bigdecimal` when `rust_decimal` is enabled is also shown, but problems with `chrono`/`time` are more common.
* **Breaking changes**:
* Significant changes to the `Migrate` trait
* `sqlx::migrate::resolve_blocking()` is now `#[doc(hidden)]` and thus SemVer-exempt.

[seaorm-2600]: https://github.com/SeaQL/sea-orm/issues/2600
[feature unification]: https://doc.rust-lang.org/cargo/reference/features.html#feature-unification
[preferred-crates]: examples/postgres/preferred-crates

[#3821]: https://github.com/launchbadge/sqlx/pull/3830
[#3821]: https://github.com/launchbadge/sqlx/pull/3821
[#3383]: https://github.com/launchbadge/sqlx/pull/3383

## 0.8.6 - 2025-05-19

Expand Down
Loading
Loading