Skip to content

Conversation

@Blankeos
Copy link
Owner

@Blankeos Blankeos commented Feb 2, 2026

Motivation

  • Move the app from a local SQLite/libsql setup to Postgres so the project can run against a standard Postgres DB and use native jsonb/timestamp types.
  • Use Kysely's PostgresDialect (via pg Pool) for the server-side query client instead of the libsql / bun-worker SQLite dialects.
  • Ensure Prisma schema, migrations, runtime types and DAO/service code handle JSON and date fields natively instead of storing them as strings.

Description

  • Replaced Kysely dialect with PostgresDialect and a pg Pool in src/server/db/kysely.ts to connect via DATABASE_URL.
  • Updated prisma/schema.prisma datasource to provider = "postgresql" and added url = env("DATABASE_URL"), and changed prisma/migrations/* SQL to use JSONB and TIMESTAMP(3) instead of DATETIME.
  • Adjusted generated Kysely types in src/server/db/types.ts to introduce Timestamp and use Date/boolean types for expires_at, created_at, updated_at, joined_at, and email_verified.
  • Converted DAO/service code to use native Date objects and a jsonEncode/jsonDecode pattern for JSON fields (added/updated usages in src/server/modules/auth/* and src/server/modules/organization/*) so JSON is persisted as jsonb and timestamps as native timestamps.
  • Added docker-compose.yml with a postgres:16 service and updated .env.example and README.md to document the example DATABASE_URL (postgresql://solid:solid@localhost:5432/solid_launch?schema=public) and local Postgres startup instructions.
  • Updated package manifests/lock to remove the libsql/bun-worker entries and add pg as the runtime dependency (package.json and bun.lock edits).

Testing

  • Attempted dependency install with bun install but it failed due to a registry error while resolving pg (GET https://registry.npmjs.org/pg - 403), so full install/build verification could not be completed.
  • No automated migrations or runtime integration tests were executed because dependencies could not be installed.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant