v0.3.2-pre.002
This commit is contained in:
14
crates/ksp-store-postgres-lib/Cargo.toml
Normal file
14
crates/ksp-store-postgres-lib/Cargo.toml
Normal file
@@ -0,0 +1,14 @@
|
||||
# file: crates/ksp-store-postgres-lib/Cargo.toml
|
||||
# version: 1
|
||||
|
||||
[package]
|
||||
name = "ksp-store-postgres-lib"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[dependencies]
|
||||
ksp-store-api = { path = "../ksp-store-api" }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
7
crates/ksp-store-postgres-lib/src/constants.rs
Normal file
7
crates/ksp-store-postgres-lib/src/constants.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
// file: crates/ksp-store-postgres-lib/src/constants.rs
|
||||
// version: 1
|
||||
|
||||
//! PostgreSQL Store backend-owned constants.
|
||||
|
||||
/// Owning tracing target reserved for events emitted by the PostgreSQL Store backend.
|
||||
pub(crate) const TRACING_TARGET: &str = "ksp-store-postgres-lib";
|
||||
21
crates/ksp-store-postgres-lib/src/lib.rs
Normal file
21
crates/ksp-store-postgres-lib/src/lib.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
// file: crates/ksp-store-postgres-lib/src/lib.rs
|
||||
// version: 1
|
||||
|
||||
#![warn(missing_docs)]
|
||||
#![deny(unreachable_pub)]
|
||||
#![forbid(unsafe_code)]
|
||||
|
||||
//! Official PostgreSQL backend implementation scaffold for KSP Store.
|
||||
//!
|
||||
//! `0.3.2-pre.002` establishes only the backend crate boundary. PostgreSQL
|
||||
//! driver, pooling, TLS, SQL, migrations and health behavior are intentionally
|
||||
//! absent until their dedicated prereleases.
|
||||
//!
|
||||
//! This crate depends on `ksp-store-api` and never on `ksp-store-lib`, which
|
||||
//! keeps backend implementation ownership acyclic and reusable behind the
|
||||
//! common facade.
|
||||
|
||||
mod constants;
|
||||
|
||||
/// Crate-owned tracing target reserved for later PostgreSQL backend behavior.
|
||||
pub(crate) use self::constants::TRACING_TARGET;
|
||||
35
crates/ksp-store-postgres-lib/tests/dependency_boundary.rs
Normal file
35
crates/ksp-store-postgres-lib/tests/dependency_boundary.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
// file: crates/ksp-store-postgres-lib/tests/dependency_boundary.rs
|
||||
// version: 1
|
||||
|
||||
#![warn(missing_docs)]
|
||||
#![deny(unreachable_pub)]
|
||||
#![forbid(unsafe_code)]
|
||||
|
||||
//! Dependency-boundary canaries for the PostgreSQL Store backend scaffold.
|
||||
|
||||
#[test]
|
||||
fn pre_002_backend_depends_on_store_api_without_reverse_facade_edge() {
|
||||
let manifest = include_str!("../Cargo.toml");
|
||||
assert!(manifest.contains("ksp-store-api = { path = \"../ksp-store-api\" }"));
|
||||
for forbidden in ["ksp-store-lib", "ksp-config-lib", "ksp-materializer", "ksp-program", "ksp-onchain-transport-lib", "ksp-offchain-transport-lib"] {
|
||||
assert!(!manifest.contains(forbidden), "forbidden PostgreSQL backend dependency detected: {forbidden}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_002_backend_does_not_advance_connection_pool_tls_or_migrations() {
|
||||
let manifest = include_str!("../Cargo.toml");
|
||||
for forbidden in ["tokio", "tokio-postgres", "deadpool-postgres", "tokio-postgres-rustls", "rustls", "sha2"] {
|
||||
assert!(!manifest.contains(forbidden), "premature PostgreSQL runtime dependency detected: {forbidden}");
|
||||
}
|
||||
let crate_root = include_str!("../src/lib.rs");
|
||||
assert!(crate_root.contains("mod constants;"));
|
||||
assert!(crate_root.contains("pub(crate) use self::constants::TRACING_TARGET;"));
|
||||
for forbidden in ["pub mod ", "pub struct", "pub enum", "pub trait", "tokio_postgres", "deadpool_postgres", "mod migration", "SELECT ", "CREATE TABLE"] {
|
||||
assert!(!crate_root.contains(forbidden), "premature PostgreSQL backend surface detected: {forbidden}");
|
||||
}
|
||||
let constants = include_str!("../src/constants.rs");
|
||||
assert!(constants.contains("pub(crate) const TRACING_TARGET: &str = \"ksp-store-postgres-lib\";"));
|
||||
return;
|
||||
}
|
||||
Reference in New Issue
Block a user