remodel-core
remodel-core is a Rust library for database modeling. It lets you build
conceptual ER models, convert them into logical relational schemas, and render
SQL DDL for supported dialects.
This crate is a Rust reimplementation of the core modeling engine from brModelo by Carlos Henrique Candido and contributors. The port keeps the same GPL-3.0-or-later licensing model.
What it provides
- Conceptual modeling primitives: entities, attributes, relationships, cardinalities, specializations, unions, and associative entities.
- Logical modeling primitives: tables, columns, primary keys, unique constraints, and foreign keys.
- Conceptual-to-logical transformation with configurable strategies for relationships, specializations, and complex attributes.
- SQL DDL rendering for PostgreSQL, MySQL, and SQLite.
- Validation diagnostics for structurally invalid diagrams.
serdesupport for persistence and interchange formats.
Installation
Quick start
use AttributeOwner;
use *;
This produces a relational model with Book, Author, and a junction table
for wrote.
Modeling pipeline
remodel-core follows the usual database-design flow:
- Build a conceptual model.
- Validate and convert it into a logical model.
- Render SQL DDL for the target database dialect.
The main APIs are:
ConceptualModelfor ER authoringConceptualModel::to_logical()for default conversiontransform::conceptual_to_logical()when you need customConvertOptionsLogicalModel::to_sql()for final DDL generation
Supported SQL dialects
- PostgreSQL
- MySQL / MariaDB
- SQLite
Validation
The library validates conceptual models before conversion. Structural problems
such as missing references or invalid identifiers are reported through
diagnostics, and conversion returns Error::Validation when errors are present.
Release
Publishing to crates.io is automated through GitHub Actions:
- Push a tag named
remodel-core-vX.Y.Z, or - Run the
Publish remodel-coreworkflow manually.
The workflow runs the crate tests and then publishes RemodelCore/ using the
repository secret CARGO_REGISTRY_TOKEN.
License
GPL-3.0-or-later.