Skip to main content

Crate razeri_plugin_contract

Crate razeri_plugin_contract 

Source
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:

  1. SqlRenderer — core SQL rendering (the four required methods)
  2. ExpressionRenderer — expressions, with ANSI defaults
  3. DdlRenderer — DDL, with ANSI defaults
  4. DmlRenderer — DML, with ANSI defaults
  5. ProcedureRenderer — stored procedures and functions
  6. FormulaRenderer — formulas, with ANSI defaults
  7. TaskRenderer — scheduled tasks
  8. ReplicationRenderer — data extraction, loading and key-function deployment
  9. StorageRenderer — partitioning, compression and index strategy
  10. DialectCapabilities — 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.