| Crates.io | declare_schema |
| lib.rs | declare_schema |
| version | 0.0.11 |
| created_at | 2024-07-09 14:19:47.627376+00 |
| updated_at | 2025-07-01 19:53:27.607347+00 |
| description | CLI / Library for Postgres schema migrations |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1297143 |
| size | 155,558 |
Experiments with Rust declarative schemas
Use sqlparser-rs for SQL -> AST, then diff ASTs to generate ALTER ASTs, then output SQL.
WARNING: Alpha software, you will likely lose data with this library.
Include database schema management in to Rust applications without the need for migration steps.
Provide a CLI tool that can generate diffs of schemas and the required ALTER statements for review to detect schema drift.
When embedded in an application or with a CLI tool keep an easy SQL -> DB flow that is clear to developers with an easy to modify schema.
CREATE EXTENSION - Can be created by name only. Cannot be DROPed.
CONSTRAINT - Cannot be changed, create a new one then drop the old one.
CREATE INDEX - Indexes cannot be ALTERed. To avoid errors in change detection/halting
method for USING that matches defaults:example: CREATE INDEX idx_id on public.test USING BTREE (id DESC)