feat(deps): add modbus, database, mocking, and async trait dependencies

Adds tokio-modbus 0.17.0 for Modbus RTU over TCP communication,
sqlx with runtime-tokio and sqlite features for async database operations,
mockall 0.13 for trait mocking in tests, and async-trait 0.1 for async trait support.

Ref: T001 (specs/001-modbus-relay-control)
This commit is contained in:
2026-01-01 13:54:13 +01:00
parent 623e77dfc9
commit 926f8da683
4 changed files with 1020 additions and 14 deletions

1023
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -14,16 +14,20 @@ path = "src/main.rs"
name = "sta"
[dependencies]
async-trait = "0.1.89"
chrono = { version = "0.4.42", features = ["serde"] }
config = { version = "0.15.19", features = ["yaml"] }
dotenvy = "0.15.7"
governor = "0.8.1"
governor = "0.10.4"
mockall = "0.14.0"
poem = { version = "3.1.12", default-features = false, features = ["csrf", "rustls", "test"] }
poem-openapi = { version = "5.1.16", features = ["chrono", "swagger-ui"] }
serde = "1.0.228"
serde_json = "1.0.148"
sqlx = { version = "0.8.6", features = ["runtime-tokio", "sqlite", "derive", "migrate"] }
thiserror = "2.0.17"
tokio = { version = "1.48.0", features = ["macros", "rt-multi-thread"] }
tokio-modbus = "0.17.0"
tracing = "0.1.44"
tracing-subscriber = { version = "0.3.22", features = ["fmt", "std", "env-filter", "registry", "json", "tracing-log"] }

View File

@@ -26,6 +26,7 @@ inputs.devenv.lib.mkShell {
cargo-tarpaulin
just
marksman # Markdown LSP server
sqlx-cli
tombi # TOML LSP server
];

View File

@@ -12,7 +12,7 @@
**Purpose**: Initialize project dependencies and directory structure
- [ ] **T001** [Setup] [TDD] Add Rust dependencies to Cargo.toml
- [x] **T001** [Setup] [TDD] Add Rust dependencies to Cargo.toml
- Add: tokio-modbus = "0.17.0", sqlx = { version = "0.8", features = ["runtime-tokio", "sqlite"] }, mockall = "0.13", async-trait = "0.1"
- **Test**: cargo check passes
- **Complexity**: Low | **Uncertainty**: Low
@@ -37,7 +37,7 @@
- [ ] **T005** [P] [Setup] [TDD] Add SQLite schema file
- Create infrastructure/persistence/schema.sql with relay_labels table
- Table: relay_labels (relay_id INTEGER PRIMARY KEY CHECK(relay_id BETWEEN 1 AND 8), label TEXT NOT NULL CHECK(length(label) <= 50))
- Table: `relay_labels (relay_id INTEGER PRIMARY KEY CHECK(relay_id BETWEEN 1 AND 8), label TEXT NOT NULL CHECK(length(label) <= 50))`
- **Test**: Schema file syntax is valid SQL
- **Complexity**: Low | **Uncertainty**: Low