Expand description
Database layer for Purwa — SQLx-first; optional SeaORM behind the sea-orm feature.
Enums§
- Purwa
OrmError - 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_URLfallback beyondAppConfig::database_url). - default_
migrations_ dir - Default migrations directory relative to the process working directory (PRD §6).
- migrate_
fresh - Development only: drop and recreate the
publicschema, then run all migrations fromdir. - 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(SQLxMigrator::undo). - migrate_
up - Apply all pending migrations from
dir(files namedVERSION_description.sqlper SQLx).