@dawn-ai/postgres-storage
v0.8.26
Published
Postgres persistence for Dawn checkpoints, threads, and permission decisions.
Downloads
802
Maintainers
Readme
@dawn-ai/postgres-storage
Supported Postgres persistence for Dawn checkpoints, Agent Protocol threads, and permission grants across application instances.
Use this when: You are replacing Dawn's local durable stores with shared Postgres persistence.
Install
pnpm add @dawn-ai/postgres-storage pgExample
import { Pool } from "pg"
import { createPostgresThreadsStore } from "@dawn-ai/postgres-storage"
const pool = new Pool({ connectionString: process.env.DATABASE_URL })
const threadsStore = createPostgresThreadsStore({ pool })
await threadsStore.ready()
// During application shutdown:
await threadsStore.close()
await pool.end()Runtime and stability
@dawn-ai/postgres-storageis a supported edge-safe application surface that requires an injected structural pool. The tested edge path is local workerd with a Neon WebSocket pool; this is not a claim about every edge host.@dawn-ai/postgres-storage/nodeis a supported node-only application surface that can create apgpool from a connection string.
Migrations are memoized per store instance. An injected pool remains caller-owned unless ownsPool: true; a pool created by the Node entry is store-owned. Close stores and caller-owned pools during application shutdown.
Related
- Postgres Storage API reference — exact options, stores, and lifecycle.
- Persistence and Tenancy — application configuration and deployment guidance.
@dawn-ai/sqlite-storage— local SQLite persistence.@dawn-ai/permissions— permission-store contracts.
Maturity and support
Dawn is pre-1.0, and its public surface can change. All publishable Dawn packages release together as a fixed group; review the @dawn-ai/postgres-storage changelog and upgrading guide before upgrading. For support, use GitHub Discussions; report defects in GitHub Issues.
License
MIT. See the repository license.
