Menu

Chat SDK adds PostgreSQL state adapter - Vercel
📰
0

Chat SDK adds PostgreSQL state adapter - Vercel

Vercel News·Hayden Bleasel·4 days ago
#OpDtzhAb
Reading 0:00
15s threshold

Chat SDK now supports PostgreSQL as a state backend, joining Redis and ioredis as a production-ready option with the new PostgreSQL adapter . Teams that already run PostgreSQL can persist subscriptions, distributed locks, and key-value cache state without adding Redis to their infrastructure. Try the PostgreSQL state adapter today: import { Chat } from "chat" ; import { createPostgresState } from "@chat-adapter/state-pg" ; const bot = new Chat ( { userName : "mybot" , adapters : { /* ... */ } , state : createPostgresState ( ) , } ) ; The adapter uses pg (node-postgres) with raw SQL queries and automatically creates the required tables on first connect. It supports TTL-based caching, distributed locking across multiple instances, and namespaced state via a configurable key prefix. Read the documentation to get started, browse the directory , or build your own adapter . Special thanks to @bai , whose community contribution in PR #154 laid the groundwork for this adapter.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More