Skip to main content

Crate purwa_orm

Crate purwa_orm 

Source
Expand description

Database layer for Purwa — SQLx-first; optional SeaORM behind the sea-orm feature.

Enums§

PurwaOrmError
Errors from connection, migrations, or missing configuration.

Functions§

connect_pool
Open a pool using a Postgres URL (typically from AppConfig::database_url).
database_url_from_config
Resolve the database URL from loaded config (no DATABASE_URL fallback beyond AppConfig::database_url).
default_migrations_dir
Default migrations directory relative to the process working directory (PRD §6).
migrate_fresh
Development only: drop and recreate the public schema, then run all migrations from dir.
migrate_rollback_one
Roll back the latest migration step. Only affects reversible migrations (paired .up.sql / .down.sql).
migrate_undo
Undo applied migrations with version greater than target (SQLx Migrator::undo).
migrate_up
Apply all pending migrations from dir (files named VERSION_description.sql per SQLx).