Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ jobs:
run: |
../scripts/check-doc-symbols.sh \
linux/ARCHITECTURE.md \
linux/docs/adding-drivers.md \
linux/docs/state-management.md \
linux/docs/storage.md \
linux/docs/testing.md \
Expand Down
4 changes: 2 additions & 2 deletions linux/crates/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ relm4.workspace = true
rustix = { workspace = true, features = ["time"] }
secrecy.workspace = true
tokio.workspace = true
tokio-util = { workspace = true, features = ["rt"] }
tokio-util.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
uuid.workspace = true
Expand All @@ -97,7 +97,7 @@ tablepro-session = { workspace = true, features = ["fakes"] }
tablepro-test-fixtures.workspace = true
tablepro-test-support.workspace = true
tempfile.workspace = true
tokio = { workspace = true, features = ["macros", "rt", "test-util"] }
tokio = { workspace = true, features = ["rt", "test-util"] }
# tokio-postgres logs through `log`, so the logging tests drive that
# bridge the way it does.
log = "0.4"
Expand Down
6 changes: 3 additions & 3 deletions linux/crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ serde.workspace = true
serde_json.workspace = true
sqlparser.workspace = true
thiserror.workspace = true
tokio = { workspace = true, features = ["io-util", "macros", "rt", "sync", "time"] }
tokio-util = { workspace = true, features = ["rt"] }
tokio = { workspace = true, features = ["io-util", "rt"] }
tokio-util.workspace = true
uuid.workspace = true

[dev-dependencies]
proptest.workspace = true
zip.workspace = true
tokio = { workspace = true, features = ["macros", "rt", "test-util"] }
tokio = { workspace = true, features = ["rt", "test-util"] }

[lints]
workspace = true
6 changes: 3 additions & 3 deletions linux/crates/drivers/clickhouse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ secrecy.workspace = true
serde.workspace = true
serde_json.workspace = true
sqlparser.workspace = true
tokio = { workspace = true, features = ["io-util", "macros", "rt", "sync", "time"] }
tokio-util = { workspace = true, features = ["rt"] }
tokio = { workspace = true, features = ["io-util", "rt"] }
tokio-util.workspace = true
tower-service.workspace = true
tracing.workspace = true
uuid.workspace = true
Expand All @@ -32,7 +32,7 @@ uuid.workspace = true
tablepro-test-fixtures.workspace = true
tablepro-test-support.workspace = true
rustls.workspace = true
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "test-util"] }
tokio = { workspace = true, features = ["test-util"] }

[lints]
workspace = true
6 changes: 3 additions & 3 deletions linux/crates/drivers/mssql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ deadpool.workspace = true
futures-util.workspace = true
secrecy.workspace = true
tiberius.workspace = true
tokio = { workspace = true, features = ["macros", "rt", "sync", "time"] }
tokio-util = { workspace = true, features = ["compat", "rt"] }
tokio = { workspace = true, features = ["rt"] }
tokio-util = { workspace = true, features = ["compat"] }
tracing.workspace = true
uuid.workspace = true

[dev-dependencies]
tablepro-test-fixtures.workspace = true
tablepro-test-support.workspace = true
tokio = { workspace = true, features = ["io-util", "macros", "rt-multi-thread", "test-util"] }
tokio = { workspace = true, features = ["io-util", "test-util"] }

[lints]
workspace = true
6 changes: 3 additions & 3 deletions linux/crates/drivers/mysql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ futures-util.workspace = true
secrecy.workspace = true
sqlx = { workspace = true, features = ["mysql", "mysql-rsa", "tls-rustls-aws-lc-rs"] }
thiserror.workspace = true
tokio = { workspace = true, features = ["macros", "rt", "sync", "time"] }
tokio-util = { workspace = true, features = ["rt"] }
tokio = { workspace = true, features = ["rt"] }
tokio-util.workspace = true
tracing.workspace = true

[dev-dependencies]
tablepro-test-fixtures.workspace = true
tablepro-test-support.workspace = true
tempfile.workspace = true
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "test-util"] }
tokio = { workspace = true, features = ["test-util"] }
tracing-subscriber.workspace = true

[lints]
Expand Down
6 changes: 3 additions & 3 deletions linux/crates/drivers/postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ futures-util.workspace = true
postgres-protocol.workspace = true
postgres-types.workspace = true
secrecy.workspace = true
tokio = { workspace = true, features = ["macros", "rt", "sync", "time"] }
tokio = { workspace = true, features = ["rt"] }
tokio-postgres.workspace = true
tokio-postgres-rustls.workspace = true
tokio-util = { workspace = true, features = ["rt"] }
tokio-util.workspace = true
tracing.workspace = true
uuid.workspace = true

[dev-dependencies]
tablepro-test-fixtures.workspace = true
tablepro-test-support.workspace = true
rustls.workspace = true
tokio = { workspace = true, features = ["io-util", "macros", "rt-multi-thread", "test-util"] }
tokio = { workspace = true, features = ["io-util", "test-util"] }

[lints]
workspace = true
2 changes: 1 addition & 1 deletion linux/crates/drivers/sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ futures.workspace = true
libsqlite3-sys.workspace = true
sqlparser.workspace = true
sqlx = { workspace = true, features = ["sqlite-unbundled"] }
tokio = { workspace = true, features = ["macros", "rt", "sync", "time"] }
tokio = { workspace = true, features = ["rt"] }
tokio-util.workspace = true
tracing.workspace = true
uuid.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions linux/crates/net/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rustls-pki-types.workspace = true
rustls-platform-verifier.workspace = true
socket2.workspace = true
thiserror.workspace = true
tokio = { workspace = true, features = ["net", "rt", "time"] }
tokio = { workspace = true, features = ["rt"] }
tracing.workspace = true

[dev-dependencies]
Expand All @@ -24,7 +24,7 @@ hyper-rustls.workspace = true
hyper-util.workspace = true
rcgen.workspace = true
tempfile.workspace = true
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "io-util"] }
tokio = { workspace = true, features = ["io-util"] }
tokio-rustls.workspace = true
tower-service.workspace = true

Expand Down
6 changes: 3 additions & 3 deletions linux/crates/session/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ tablepro-test-support = { workspace = true, optional = true }
futures.workspace = true
secrecy.workspace = true
thiserror.workspace = true
tokio = { workspace = true, features = ["rt", "sync", "time"] }
tokio-util = { workspace = true, features = ["rt"] }
tokio = { workspace = true, features = ["rt"] }
tokio-util.workspace = true
tracing.workspace = true
uuid.workspace = true

Expand All @@ -29,7 +29,7 @@ tablepro-driver-postgres.workspace = true
tablepro-test-fixtures.workspace = true
tablepro-test-support.workspace = true
tempfile.workspace = true
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "test-util", "sync"] }
tokio = { workspace = true, features = ["test-util"] }

[lints]
workspace = true
4 changes: 2 additions & 2 deletions linux/crates/ssh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ futures.workspace = true
rustix = { workspace = true, features = ["fs", "process"] }
secrecy.workspace = true
thiserror.workspace = true
tokio = { workspace = true, features = ["io-util", "process", "net", "time", "sync", "fs"] }
tokio = { workspace = true, features = ["io-util", "fs"] }
tokio-util.workspace = true
tracing.workspace = true
uuid.workspace = true
Expand All @@ -23,7 +23,7 @@ zeroize.workspace = true
tablepro-test-support.workspace = true
tempfile.workspace = true
testcontainers.workspace = true
tokio = { workspace = true, features = ["macros", "rt", "test-util"] }
tokio = { workspace = true, features = ["rt", "test-util"] }

[lints]
workspace = true
2 changes: 1 addition & 1 deletion linux/crates/storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ secrecy.workspace = true
serde.workspace = true
serde_json.workspace = true
thiserror.workspace = true
tokio = { workspace = true, features = ["fs", "sync"] }
tokio = { workspace = true, features = ["fs"] }
uuid.workspace = true
sqlx = { workspace = true, features = ["sqlite-unbundled", "migrate", "macros"] }
chrono.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion linux/crates/test-fixtures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tempfile.workspace = true
testcontainers.workspace = true
testcontainers-modules = { workspace = true, features = ["postgres", "mssql_server"] }
thiserror.workspace = true
tokio = { workspace = true, features = ["fs", "io-util", "process"] }
tokio = { workspace = true, features = ["fs", "io-util"] }
uuid.workspace = true

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions linux/crates/test-support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ secrecy.workspace = true
tempfile.workspace = true
uuid.workspace = true
futures.workspace = true
tokio = { workspace = true, features = ["io-util", "macros", "net", "rt", "sync", "time"] }
tokio = { workspace = true, features = ["io-util", "rt"] }
tokio-util.workspace = true

[dev-dependencies]
tokio = { workspace = true, features = ["macros", "rt", "rt-multi-thread", "test-util"] }
tokio = { workspace = true, features = ["rt", "test-util"] }

[lints]
workspace = true
14 changes: 7 additions & 7 deletions linux/docs/adding-drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@ tablepro-core.workspace = true
tablepro-net.workspace = true
async-trait.workspace = true
secrecy.workspace = true
tokio = { workspace = true, features = ["macros", "rt", "sync", "time"] }
tokio-util = { workspace = true, features = ["rt"] }
tokio = { workspace = true, features = ["rt"] }
tokio-util.workspace = true
tracing.workspace = true

[dev-dependencies]
tablepro-test-fixtures.workspace = true
tablepro-test-support.workspace = true
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "test-util"] }
tokio = { workspace = true, features = ["test-util"] }

[lints]
workspace = true
```

A driver depends on `tablepro-core`, and on `tablepro-net` when it speaks TLS or dials TCP. `secrecy` reads the password of a password login. It never depends on GTK, on `tablepro-session`, on `tablepro-ssh` or on another driver. Add the crate to `members` and to `[workspace.dependencies]` in `linux/Cargo.toml`.
A driver depends on `tablepro-core`, and on `tablepro-net` when it speaks TLS or dials TCP. `secrecy` reads the password of a password login. It never depends on GTK, on `tablepro-session`, on `tablepro-ssh` or on another driver. Add the crate to `members` and to `[workspace.dependencies]` in `linux/Cargo.toml`. A member lists only the features its workspace entry does not already name.

## 3. `DatabaseDriver` and capabilities

Expand Down Expand Up @@ -316,7 +316,7 @@ A run streams `ResultEvent`s into a `ResultSink`:

### Structure changes

`DdlDialect` lives in the driver's `src/ddl.rs`, implemented on the dialect type itself, so `ddl()` returns `Some(self)`. It plans every structure change the Structure tab makes, against the `TableDefinition` that `fetch_table_definition` returned:
`DdlDialect` lives in the driver's `ddl` module, as `crates/drivers/postgres/src/ddl.rs` or, once it spans files, `crates/drivers/sqlite/src/ddl/`, implemented on the dialect type itself, so `ddl()` returns `Some(self)`. It plans every structure change the Structure tab makes, against the `TableDefinition` that `fetch_table_definition` returned:

| Method | What it does |
|---|---|
Expand All @@ -329,7 +329,7 @@ A run streams `ResultEvent`s into a `ResultSink`:
| `plan_drop_table` | The default writes `DROP TABLE [IF EXISTS] <table> [CASCADE]`. |
| `create_table_script` | The server's own CREATE statement where the engine keeps one, and `NoTableSource` when the definition carries none; the default writes it from the definition. |

Plans quote every name through the dialect, splice a catalogue type unchanged and a typed one only after `parse_type` accepts it, and write a literal default through `SqlDialect::literal`. `tablepro_core::ddl::ddl_sql` has the pieces most engines share. The golden tests for each plan sit in `src/ddl.rs`, and the driver's integration target runs `ddl_conformance_suite!` (see [testing.md](testing.md#ddl-conformance)).
Plans quote every name through the dialect, splice a catalogue type unchanged and a typed one only after `parse_type` accepts it, and write a literal default through `SqlDialect::literal`. `tablepro_core::ddl::ddl_sql` has the pieces most engines share. The golden tests for each plan sit in that module, and the driver's integration target runs `ddl_conformance_suite!` (see [testing.md](testing.md#ddl-conformance)).

## 8. Registration

Expand All @@ -354,7 +354,7 @@ Without this step the crate compiles and the app never offers it.
The layout every driver follows:

- Unit tests next to the code, for pure logic: the dialect, error mapping, decoders, statement classification.
- `tests/integration/main.rs` with one module per topic: `support.rs` (start a fixture, connect, run), `conformance_engine.rs`, `tls.rs` for a network engine, and the engine's own behaviour (`metadata.rs`, `write_batch.rs`, `cancellation.rs` and so on). A network engine's test starts its own container and is `#[ignore = "requires docker"]`.
- One integration target with one module per topic, as `crates/drivers/postgres/tests/integration/main.rs`: `support.rs` (start a fixture, connect, run), `conformance_engine.rs`, `tls.rs` for a network engine, and the engine's own behaviour (`metadata.rs`, `write_batch.rs`, `cancellation.rs` and so on). A network engine's test starts its own container and is `#[ignore = "requires docker"]`.
- A container fixture in `crates/test-fixtures` for anything the default image cannot do: TLS from the generated PKI, a second principal that logs in with a client certificate.

The conformance suites are the contract's own tests. The driver's `conformance_engine.rs` invokes the connection and DDL suites, and a network engine's `tls.rs` the TLS suite. [testing.md](testing.md#conformance) has the adapter traits, the flags and the cases, with the [DDL](testing.md#ddl-conformance) and [TLS](testing.md#tls-conformance) suites after them.
Expand Down
Loading