Skip to content

Commit

Permalink
use real postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
Satont committed Oct 24, 2024
1 parent 6763b2c commit b0aa40d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 255 deletions.
10 changes: 8 additions & 2 deletions packages/psql/__tests__/node.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import test from 'node:test';
import * as assert from 'node:assert';

import { newDb } from 'pg-mem';
import { PsqlAdapter } from '../src/mod.ts';
import pg from 'pg';
import { session } from 'grammy';
import * as utils from '@grammyjs/storage-utils';

test('Pizza counter test', async () => {
const bot = utils.createBot();
const client = new (newDb().adapters.createPg().Client)();
const client = new pg.Client({
user: 'postgres',
password: 'postgres',
database: 'postgres',
host: 'localhost',
port: 5432,
});

bot.use(session({
initial: () => ({ pizzaCount: 0 }),
Expand Down
3 changes: 1 addition & 2 deletions packages/psql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
"@grammyjs/storage-utils": "workspace:*",
"@types/pg": "^8.11.2",
"grammy": "^1.30.0",
"pg": "^8.11.3",
"pg-mem": "^2.8.1"
"pg": "^8.11.3"
},
"gitHead": "a7758c4f957f103a14832088c6858d693c444576",
"peerDependencies": {
Expand Down
Loading

0 comments on commit b0aa40d

Please sign in to comment.