Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ when the database runs in a container. For local Oracle runs, add
`-- --test-threads=2` to avoid overwhelming the listener. Check affected matrix results for SQL
execution changes; SQLite alone cannot establish portability.

ODBC databases can also run on sqlx 0.9, through the [sqlx-odbc](https://github.com/lovasoa/sqlx-odbc) driver. This is the unstable migration path for [#1056](https://github.com/sqlpage/SQLPage/issues/1056), and releases do not include it. To use it, build with the `unstable-sqlx-next` feature and set `SQLPAGE_UNSTABLE_SQLX_NEXT=true`. With this driver, migrations, `sqlpage_files` and CSV imports stop with an error that names the missing feature.
SQL Server and ODBC databases can also run on sqlx 0.9, through the [sqlx-sqlserver](https://github.com/lovasoa/sqlx-sqlserver) and [sqlx-odbc](https://github.com/lovasoa/sqlx-odbc) drivers. This is the unstable migration path for [#1056](https://github.com/sqlpage/SQLPage/issues/1056), and releases do not include it. To use it, build with the `unstable-sqlx-next` feature and set `SQLPAGE_UNSTABLE_SQLX_NEXT=true`. The feature needs OpenSSL, which the Nix shell provides. With these drivers, migrations, `sqlpage_files` and CSV imports stop with an error that names the missing feature.

```bash
SQLPAGE_UNSTABLE_SQLX_NEXT=true DATABASE_URL='mssql://root:Password123!@localhost/sqlpage' cargo test --features unstable-sqlx-next
SQLPAGE_UNSTABLE_SQLX_NEXT=true DATABASE_URL='Driver=DuckDB;Database=/tmp/sqlpage-test.duckdb' cargo test --features unstable-sqlx-next
```

Expand Down
213 changes: 211 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ tokio-util = "0.7.12"
openidconnect = { version = "4.0.0", default-features = false, features = ["accept-rfc3339-timestamps"] }
encoding_rs = "0.8.35"
odbc-sys = { version = "0", optional = true }
sqlx-next = { package = "sqlx", version = "0.9", default-features = false, features = ["runtime-tokio"], optional = true }
sqlx-next = { package = "sqlx", version = "0.9", default-features = false, features = ["runtime-tokio", "uuid"], optional = true }
sqlx-odbc = { version = "0.0.3", default-features = false, features = ["bigdecimal", "chrono"], optional = true }
sqlx-sqlserver = { version = "0.0.3", default-features = false, features = ["bigdecimal", "chrono", "migrate", "uuid"], optional = true }
regex = "1"
lettre = { version = "0.11", default-features = false, features = [
"aws-lc-rs",
Expand All @@ -139,7 +140,7 @@ opentelemetry-semantic-conventions = { version = "0.33", features = ["semconv_ex

[features]
default = []
unstable-sqlx-next = ["dep:sqlx-next", "dep:sqlx-odbc"]
unstable-sqlx-next = ["dep:sqlx-next", "dep:sqlx-odbc", "dep:sqlx-sqlserver"]
odbc-static = ["odbc-sys", "odbc-sys/vendored-unix-odbc"]
lambda-web = [
"dep:actix-http",
Expand Down
10 changes: 7 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@
rustToolchainFor = pkgs: pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;

# odbc-sys links against a driver manager, and the C sources vendored by
# aws-lc-sys, libsqlite3-sys and zstd-sys need a compiler. Nothing here
# reaches for OpenSSL: SQLPage speaks TLS through rustls. build.rs embeds
# the browser assets, so every cargo gate builds them with npm first.
# aws-lc-sys, libsqlite3-sys and zstd-sys need a compiler. SQLPage speaks
# TLS through rustls; only the unstable-sqlx-next feature links OpenSSL,
# because sqlx-sqlserver requires native-tls. build.rs embeds the browser
# assets, so every cargo gate builds them with npm first.
cargoRuntime = pkgs: [
(rustToolchainFor pkgs)
pkgs.stdenv.cc
Expand Down Expand Up @@ -128,6 +129,8 @@

cargoEnv = pkgs: {
LIBRARY_PATH = "${pkgs.unixodbc}/lib";
OPENSSL_LIB_DIR = "${lib.getLib pkgs.openssl}/lib";
OPENSSL_INCLUDE_DIR = "${lib.getDev pkgs.openssl}/include";
};

# Playwright is installed via npm, we we need to set the browser paths.
Expand Down Expand Up @@ -270,6 +273,7 @@
++ lib.attrValues (gatesFor pkgs);

buildInputs = with pkgs; [
openssl
unixodbc
zstd
];
Expand Down
Loading
Loading