razeri_plugin_contract/lib.rs
1// Copyright (C) 2026 Gabriel Shea <gshea@ideapivot.com> - All Rights Reserved
2
3#![warn(missing_docs)]
4
5//! # razeri-plugin-contract
6//!
7//! **The contract a Razeri dialect plugin is written against.**
8//!
9//! This crate and `razeri-plugin-api` are the two open crates in Razeri's
10//! workspace. Everything a plugin author needs in order to *describe* and
11//! *render* a database platform lives here; nothing else does. It depends on
12//! `serde` and on nothing else at all, which is what lets a plugin be built,
13//! published and consumed outside this repository.
14//!
15//! ## What is in here
16//!
17//! **The rendering hierarchy** — ten traits, layered so that a new dialect
18//! implements four required methods and inherits ANSI-standard behaviour for
19//! the rest:
20//!
21//! 1. [`SqlRenderer`] — core SQL rendering (the four required methods)
22//! 2. [`ExpressionRenderer`] — expressions, with ANSI defaults
23//! 3. [`DdlRenderer`] — DDL, with ANSI defaults
24//! 4. [`DmlRenderer`] — DML, with ANSI defaults
25//! 5. [`ProcedureRenderer`] — stored procedures and functions
26//! 6. [`FormulaRenderer`] — formulas, with ANSI defaults
27//! 7. [`TaskRenderer`] — scheduled tasks
28//! 8. [`ReplicationRenderer`] — change data capture
29//! 9. [`StorageRenderer`] — partitioning, compression and index strategy
30//! 10. [`DialectCapabilities`] — what the platform's SQL can and cannot do
31//!
32//! **The vocabulary those traits speak**: [`DataType`] and [`DataTypeRef`], the
33//! [`storage_strategy::StoragePlan`] a [`StorageRenderer`] translates, the
34//! [`StoragePlatform`] a storage plugin names, and [`DialectFamily`], the
35//! platform's own identity.
36//!
37//! **The decisions a dialect states rather than a core crate deciding for it**,
38//! starting with [`SidSpelling`] — how this engine spells a surrogate key —
39//! and continuing with [`ProcedureForm`] and [`ScalarFunctionForm`], the
40//! routine grammars it speaks, and [`MergeShape`], how it upserts.
41//!
42//! ## What is deliberately not in here
43//!
44//! Razeri's design model, its surrogate-key *derivation*, and every renderer
45//! that produces Razeri's own output. A plugin says what its engine spells;
46//! Razeri composes. That division is why one contract crate can be open while
47//! the product is not.
48
49pub mod agnostic;
50pub mod capabilities;
51pub mod constraint_enforcement;
52pub mod data_type;
53pub mod dialect_family;
54pub mod formula_renderer;
55pub mod merge_shape;
56pub mod renderer;
57pub mod replication;
58pub mod routine_form;
59pub mod sid_spelling;
60pub mod storage_platform;
61pub mod storage_renderer;
62pub mod storage_strategy;
63pub mod task_renderer;
64
65pub use agnostic::*;
66pub use capabilities::*;
67pub use constraint_enforcement::*;
68pub use data_type::{DataType, DataTypeRef};
69pub use dialect_family::DialectFamily;
70pub use formula_renderer::*;
71pub use merge_shape::*;
72pub use renderer::*;
73pub use replication::*;
74pub use routine_form::*;
75pub use sid_spelling::*;
76pub use storage_platform::StoragePlatform;
77pub use storage_renderer::*;
78pub use task_renderer::*;