{
"$schema": "https://raw.githubusercontent.com/dev-five-git/vespertide/main/schemas/model.schema.json",
"name": "user",
"columns": [
{ "name": "id", "type": "integer", "primary_key": true },
{ "name": "email", "type": "text", "unique": true, "index": true },
{ "name": "name", "type": { "kind": "varchar", "length": 100 } },
{
"name": "status",
"type": { "kind": "enum", "name": "user_status",
"values": ["active", "inactive", "banned"] },
"default": "'active'"
},
{ "name": "created_at", "type": "timestamptz", "default": "NOW()" }
]
}{
"$schema": "https://raw.githubusercontent.com/dev-five-git/vespertide/main/schemas/model.schema.json",
"name": "post",
"columns": [
{ "name": "id", "type": "integer", "primary_key": true },
{ "name": "title", "type": { "kind": "varchar", "length": 200 } },
{ "name": "body", "type": "text" },
{
"name": "author_id",
"type": "integer",
"foreign_key": {
"ref_table": "user",
"ref_columns": ["id"],
"on_delete": "cascade"
},
"index": true
},
{
"name": "status",
"type": { "kind": "enum", "name": "post_status",
"values": ["draft", "published", "archived"] },
"default": "'draft'"
}
]
}# Initialize a new project
$ vespertide init
# Scaffold a model
$ vespertide new post
# Edit models/post.json, then preview the diff
$ vespertide diff
+ create_table post (id, title, body, author_id, status)
+ create_enum post_status [draft, published, archived]
+ create_index ix_post_author_id ON post (author_id)
# Inspect dialect-specific SQL
$ vespertide sql --backend postgres
# Persist as a migration file
$ vespertide revision -m "create post table"use sea_orm::Database;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let db = Database::connect("postgres://user:pass@localhost/mydb").await?;
// Generated at compile time, run on startup.
vespertide::vespertide_migration!(db).await?;
Ok(())
}# Generate Rust SeaORM entities
$ vespertide export --orm seaorm
# Or Python — SQLAlchemy
$ vespertide export --orm sqlalchemy
# Or FastAPI-flavoured SQLModel
$ vespertide export --orm sqlmodel
# Or Go — GORM
$ vespertide export --orm gorm
# Or Django
$ vespertide export --orm django