ORM & Database
The sqlx-backed query builder, models, migrations, seeders, factories, and vector search.
The ORM (rustasea-orm) provides a fluent, chainable query builder over sqlx with drivers for Postgres, MySQL, SQLite, and MongoDB (feature-gated).
Query builder
Models
#[derive(Model)] supplies id, created_at, updated_at, and deleted_at (soft deletes), with a snake_plural table convention.
Inspect a model without reading its source:
Migrations
Migrations run through a custom Migrator with versioned, reversible steps:
Connection resolution prefers DATABASE_URL, then DATABASE__URL, then config/database.toml. Migrations are database-agnostic, and seeders and factories are supported for test data.
Vector search
Semantic search is part of the data layer, not an add-on: whereVectorSimilarTo and a vector column type ship alongside the query builder, backed by pgvector behind the vector feature.
dropVectorIndex and Str::toEmbeddings round out the surface. MemoryVectorStore is the default; PgVectorStore executes real similarity queries when the pgvector feature is enabled. Embeddings currently fall back to a deterministic stub unless a provider is configured.
Example application
The runnable rustasea-app binary ships a small, compiling example of the scaffold's app/ layout:
- an Eloquent-style
Postmodel with an in-memoryPostRepository - a JSON CRUD
PostControllerimplementing the baseControllertrait StorePostRequest/UpdatePostRequestvalidatable form requests- a
CreatePostActiondemonstrating the Action pattern
Routes are registered in routes/examples.rs and served at /examples/posts (index, show, store, update, destroy).
Last updated Sep 22, 2026