hominem-database

Installation
SKILL.md

Hominem database

packages/db is PostgreSQL access code and server-only. Client code uses @hominem/rpc, never the database package directly.

Local development: migrations, codegen, and repositories

Migrations and generated types

  • packages/db/src/types/database.ts is generated by kysely-codegen; never edit it manually as the final state. After writing or editing a migration, immediately run just db migrate then just db codegen yourself against the already-running local dev database (and just db migrate test if a test database is running) — do not leave this for the user to do. A hand-edited database.ts is only a stopgap for typechecking mid-task; it must be replaced by real codegen output before the change is considered done.
  • Migrations live in packages/db/migrations/, use Goose SQL Up and Down markers, and are idempotent because CI runs goose up twice.
  • The schemas are auth, app, and ops. pgcrypto, pg_trgm, unaccent, vector, earthdistance, ltree, and fuzzystrmatch are already installed; do not create them again.

After any schema change:

just db migrate            # apply migrations using DATABASE_URL
just db codegen            # regenerate Kysely types using DATABASE_URL
Installs
2
GitHub Stars
1
First Seen
12 days ago
hominem-database — ponti-studios/kernel