@grammyjs/storage-psql
v2.4.2
Published
PSQL storage for grammY library.
Downloads
1,875
Readme
PSQL storage adapter for grammY
Storage adapter that can be used to store your session data in PostgreSQL when using sessions.
Installation
Node
npm install @grammyjs/storage-psql pg --save
Deno
import { PsqlAdapter } from "https://deno.land/x/grammy_storages/psql/src/mod.ts";
import { Client } from "https://deno.land/x/[email protected]/mod.ts";
Usage
You can check examples folder
Vendor Examples
Vercel Postgres (Neon)
import { createClient } from "@vercel/postgres";
import { PsqlAdapter } from "@grammyjs/storage-psql";
const client = createClient();
await client.connect();
bot.use(
session({
storage: await PsqlAdapter.create({ tableName: 'sessions', client }),
})
);