Skip to main content

pgevolve_core/
lib.rs

1//! `pgevolve-core` — the declarative-schema-management engine.
2//!
3//! This crate performs no network I/O: live-database access is injected by the
4//! caller via a `CatalogQuerier` implementation, and the crate returns IR,
5//! diffs, and plans as data. (It does read source `.sql` files from disk in
6//! [`parse::parse_directory`].) See the workspace `docs/superpowers/specs/` for
7//! the design.
8#![warn(missing_docs)]
9#![deny(unsafe_code)]
10// ParseError + CatalogError carry rich SourceLocation / QualifiedName context
11// in many variants, which grows the enum past clippy's 128-byte
12// `result_large_err` threshold. Boxing every error site would obscure the
13// error-handling code with `Box<…>::new(…)` noise without changing the
14// observable behavior — error paths are off the hot path. Allow crate-
15// wide rather than scattering `#![allow]` annotations across every parse /
16// catalog file.
17#![allow(clippy::result_large_err)]
18
19pub mod catalog;
20pub mod diff;
21pub mod error;
22pub mod identifier;
23pub mod ir;
24pub mod lint;
25pub mod parse;
26pub mod plan;
27pub mod render;
28
29pub use crate::parse::normalize_body::{BodyError, NormalizedBody};
30
31/// Crate version, exposed for embedding in plan manifests.
32pub const VERSION: &str = env!("CARGO_PKG_VERSION");
33
34#[cfg(test)]
35mod tests {
36    use super::*;
37
38    #[test]
39    fn version_is_nonempty() {
40        assert!(!VERSION.is_empty());
41    }
42}