@sealant/db
Purpose
@sealant/db is the shared PostgreSQL + Drizzle package for control-plane persistence.
It stores durable state for Sealant's two core product domains:
- sandboxes
- issue workflows
Why this package exists
- Keep schema and repositories centralized.
- Ensure API and worker use one typed persistence contract.
- Provide migration and env parsing utilities in one place.
What it provides
- database client creation and lifecycle helpers
- Drizzle schema exports and inferred table types
- domain repositories for sandbox lifecycle, issue workflows, source integrations, and profiles
- payload schema re-exports from
@sealant/validators - migration entrypoints and helper scripts
Core exports are defined in packages/db/src/index.ts.
Key schema groups
Auth
usersessionaccountverification
Sandboxes
sandboxessandbox_attemptssandbox_attempt_snapshotssandbox_runtime_instancessandbox_run_links
Sandbox build jobs
oci_image_build_jobs
Note: repository and type exports still include compatibility aliases such as sandboxBuildJobs
while migration to the oci_image_build_jobs table name is completed.
Issue workflows
issue_workflowsissue_workflow_executionsissue_workflow_execution_eventsissue_workflow_execution_validation_resultsissue_workflow_execution_diff_filesissue_workflow_execution_artifactsissue_workflow_execution_summariesissue_workflow_execution_pull_request_linksissuespull_requestsissue_pull_request_links
Source/provider integration
repositoriesgithub_app_installationsgithub_installation_repositoriesgithub_installation_user_grantsgithub_webhook_deliveries
Profiles and secrets
profilesprofile_revisionsprofile_env_varsprofile_secret_bindingsprofile_ssh_settingsprofile_ssh_key_bindingsrepository_profilesrepository_profile_revisionsrepository_profile_profile_linkssecretssecret_versionsssh_keys
Package resolution cache
package_resolution_cache_entries
Payload contracts
packages/db/src/payloads.ts re-exports shared sandbox payload schemas and types from
@sealant/validators:
newSandboxSchema/NewSandboxsandboxBuildSchema/SandboxBuildsandboxLaunchSchema/SandboxLaunch
Environment
DATABASE_URL(default:postgresql://sealant:sealant@127.0.0.1:5433/sealant_control_plane)
Scripts
pnpm --filter @sealant/db db:generatepnpm --filter @sealant/db db:migratepnpm --filter @sealant/db lintpnpm --filter @sealant/db typecheck
Related docs
- db-effect-service-layer.md - step-by-step walkthrough of the Effect service tag and live integration layer used for DB runtime composition.
- db-effect-postgres-follow-up-plan.md - incremental plan
to migrate DB runtime wiring to Drizzle
connect-effect-postgres.