djogi-cli 0.1.0-alpha.11

CLI for the Djogi framework — migrations, shell, db reset, status
Documentation
[package]
name = "djogi-cli"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
authors.workspace = true
rust-version.workspace = true
description = "CLI for the Djogi framework — migrations, shell, db reset, status"
documentation = "https://docs.rs/djogi-cli"
readme = "README.md"
keywords = ["djogi", "cli", "migrate", "orm"]
categories = ["command-line-utilities", "database"]

[[bin]]
name = "djogi"
path = "src/main.rs"

[lib]
path = "src/lib.rs"

[dependencies]
clap.workspace = true
tokio.workspace = true
djogi.workspace = true
# Used by the `migrations compose` glue to take the compose-time
# clock that lands in the version slug. The djogi crate already
# carries `time` via the workspace dep; the CLI binary picks it up
# directly so the compose path stays a thin wrapper.
time.workspace = true
# Used by the `live` subcommand to surface typed CLI errors
# (`LiveCmdError`) without per-call boilerplate.
thiserror.workspace = true
# Used by `verify` to compare the audit-DB error's SQLSTATE against
# `SqlState::UNDEFINED_TABLE` (`42P01`) — the constant lives in
# `tokio_postgres::error`. djogi already depends on tokio-postgres
# transitively; declaring it directly here keeps the import path
# stable (no `djogi::__private::*` reach-through from CLI code).
tokio-postgres.workspace = true
# Used by `db reset` (issue #118) to plumb the audit-DB
# pool from `djogi::migrate::build_audit_pool` into
# `ResetRequest::audit_pool`. The runner exposes the raw deadpool
# handle on `RunnerCtx::audit_pool` deliberately (see the doc on
# that field for the rationale); declaring deadpool-postgres directly
# here mirrors the same "stable import path" reasoning as the
# tokio-postgres dep above.
deadpool-postgres.workspace = true
# Used by `db reset` (issue #118) to emit best-effort
# degradation warnings when audit-pool URL resolution or pool
# construction fails. djogi already depends on tracing transitively;
# declaring it directly here keeps the macro path stable.
tracing.workspace = true
# Used by `analyze` to derive `Serialize` on `TableHealth` and
# `Recommendation` so T10.2 can emit deterministic JSON output via
# `serde_json`. The pure recommend() layer (T10.1) only needs the
# derive; the JSON encoder lands with the live-DB wiring.
serde.workspace = true
# Used by `analyze --format json` to emit a deterministic, sorted
# array of `{table_name, recommendation, ...}` rows. We pick
# `to_writer_pretty` so CI dashboards can diff yesterday's output
# against today's without reformatting first; serde's struct field
# order is preserved by `serde_json` so projection through a named
# `Row` struct gives byte-stable output.
serde_json.workspace = true
# Used by `djogi schema` (T12.2) to walk
# `inventory::iter::<&'static ModelDescriptor>` and emit a
# deterministic JSON dump of every registered model. The descriptor
# crate (`djogi`) registers models via the same `inventory` crate;
# the CLI binary must link the same version so the iter resolves.
inventory.workspace = true
# Re-exported from djogi-macros so adopters can use
# `djogi_cli::djogi_main!(…)` and `djogi_cli::link_anchor!(Model)` at
# the binary entry point to prevent LTO from dropping inventory data.
djogi-macros.workspace = true

# djogi#119 — the CLI integration tests below import shared helpers
# from `djogi::testing::cli`, which is gated behind djogi's `testing`
# feature. Listing djogi here as a dev-dep with the feature enabled
# unions the feature only for test/example/bench builds; ordinary
# `cargo build -p djogi-cli` continues to use the regular
# [dependencies] entry above. Test-built artifacts may see the unified
# feature, which is acceptable because `testing` only exposes test
# helpers.
[dev-dependencies]
djogi = { workspace = true, features = ["testing"] }

# T10.3 spawns the compiled `djogi` binary as a subprocess, seeds a
# per-test database via `#[djogi_test]`, and asserts CLI output.
# Cargo only auto-discovers tests directly under `tests/*.rs`; the
# explicit `[[test]]` entries below register the subdirectory layout.

[[test]]
name = "djogi_verify_cli"
path = "tests/internal/djogi_verify_cli.rs"
harness = true

[[test]]
name = "djogi_analyze_recommendations"
path = "tests/internal/djogi_analyze_recommendations.rs"
harness = true

[[test]]
name = "adopter_linked_cli"
path = "tests/internal/adopter_linked_cli.rs"
harness = true

[[test]]
name = "descriptor_provider"
path = "tests/internal/descriptor_provider.rs"
harness = true