Skip to content

Add user schema and CRUD package - #2

Draft
ThorbjoernTasche wants to merge 1 commit into
mainfrom
codex/add-user-package
Draft

Add user schema and CRUD package#2
ThorbjoernTasche wants to merge 1 commit into
mainfrom
codex/add-user-package

Conversation

@ThorbjoernTasche

Copy link
Copy Markdown
Owner

Summary

  • add the @beyond/user workspace package with a PostgreSQL users schema
  • add CRUD operations for create, lookup, list, update, and delete
  • return public user records only; password hashes are never selected or returned
  • add Drizzle migration 0000_create-users.sql with unique username and email constraints
  • update workspace and Drizzle configuration to use the shared package

Why

This introduces a reusable data model for users while keeping domain persistence code outside the API application. The password field is explicitly documented as a one-way hash supplied by the caller.

Validation

  • bun install --frozen-lockfile
  • bun run test — 6 passing tests across the gateway and user package
  • bun run typecheck
  • docker compose config --quiet
  • bun run db:generate
  • bun run db:migrate against ephemeral PostgreSQL
  • live CRUD verification: create, find, update, list, and delete, with no password field in returned records

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant