Expand description
§razeri-plugin-contract
The contract a Razeri dialect plugin is written against.
This crate and razeri-plugin-api are the two open crates in Razeri’s
workspace. Everything a plugin author needs in order to describe and
render a database platform lives here; nothing else does. It depends on
serde and on nothing else at all, which is what lets a plugin be built,
published and consumed outside this repository.
§What is in here
The rendering hierarchy — ten traits, layered so that a new dialect implements four required methods and inherits ANSI-standard behaviour for the rest:
SqlRenderer— core SQL rendering (the four required methods)ExpressionRenderer— expressions, with ANSI defaultsDdlRenderer— DDL, with ANSI defaultsDmlRenderer— DML, with ANSI defaultsProcedureRenderer— stored procedures and functionsFormulaRenderer— formulas, with ANSI defaultsTaskRenderer— scheduled tasksReplicationRenderer— data extraction, loading and key-function deploymentStorageRenderer— partitioning, compression and index strategyDialectCapabilities— what the platform’s SQL can and cannot do
The vocabulary those traits speak: DataType and DataTypeRef, the
storage_strategy::StoragePlan a StorageRenderer translates, the
StoragePlatform a storage plugin names, and DialectFamily, the
platform’s own identity.
The decisions a dialect states rather than a core crate deciding for it,
starting with SidSpelling — how this engine spells a surrogate key —
and continuing with ProcedureForm and ScalarFunctionForm, the
routine grammars it speaks, and MergeShape, how it upserts.
The surrogate key’s composition — sid turns a SidSpelling into
the key expression an engine runs. It is here rather than in the product
because a dialect author who cannot render their own key expression cannot
run it either, and “the same key on every engine” is then a claim nobody
outside this repository can check.
§What is deliberately not in here
Razeri’s design model and every renderer that produces Razeri’s own output. A plugin says what its engine spells; Razeri composes. That division is why one contract crate can be open while the product is not.
Re-exports§
pub use data_type::DataType;pub use data_type::DataTypeRef;pub use dialect_family::DialectFamily;pub use sid::sid_expression;pub use storage_platform::StoragePlatform;pub use agnostic::*;pub use capabilities::*;pub use constraint_enforcement::*;pub use formula_renderer::*;pub use merge_shape::*;pub use renderer::*;pub use replication::*;pub use routine_form::*;pub use routine_spec::*;pub use sid_spelling::*;pub use storage_renderer::*;pub use task_renderer::*;
Modules§
- agnostic
- Agnostic dialect and ANSI data-type rendering.
- capabilities
- Boolean capability flags with conservative defaults.
- constraint_
enforcement - Whether this engine actually checks the constraints it accepts — the dialect’s answer, and the one place the rendered DDL and the docs read it from.
- data_
type - Generic data types for cross-database compatibility.
- dialect_
family - Dialect Family Definitions
- formula_
renderer - Formula-level rendering extensions with ANSI defaults.
- merge_
shape - How this engine performs an upsert — a shape the dialect describes, not a switch it flips.
- renderer
- Layered rendering traits for SQL generation.
- replication
- Replication rendering traits with ANSI defaults.
- routine_
form - Which routine grammar this engine speaks — the dialect’s answer, not a core crate’s guess about its name.
- routine_
spec - The routine Razeri composed, handed to a dialect that spells its own grammar.
- sid
- The one derivation of a surrogate key, composed from the vocabulary a dialect states.
- sid_
spelling - How this engine spells a surrogate key — the one thing about the key a dialect decides.
- storage_
platform - Storage platform enumeration for raw file management.
- storage_
renderer - Storage rendering trait for partition, compression, and index strategies.
- storage_
strategy - Agnostic storage strategy types: partition, compression, index.
- task_
renderer - Task and schedule rendering extensions.