Skip to content

Commit 653f070

Browse files
committed
Bumped to 0.12.5
1 parent c15e238 commit 653f070

File tree

4 files changed

+54
-54
lines changed

4 files changed

+54
-54
lines changed

src/package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@event-driven-io/pongo-core",
3-
"version": "0.12.4",
3+
"version": "0.12.5",
44
"description": "Pongo - Mongo with strong consistency on top of Postgres",
55
"type": "module",
66
"engines": {

src/packages/pongo/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@event-driven-io/pongo",
3-
"version": "0.12.4",
3+
"version": "0.12.5",
44
"description": "Pongo - Mongo with strong consistency on top of Postgres",
55
"type": "module",
66
"scripts": {

src/packages/pongo/src/core/pongoClient.connections.int.spec.ts

+49-49
Original file line numberDiff line numberDiff line change
@@ -47,40 +47,40 @@ void describe('Pongo collection', () => {
4747
};
4848

4949
void describe('Pool', () => {
50-
// void it('connects using pool', async () => {
51-
// const pool = new pg.Pool({ connectionString });
52-
53-
// try {
54-
// await insertDocumentUsingPongo(pool);
55-
// } catch (error) {
56-
// console.log(error);
57-
// } finally {
58-
// await pool.end();
59-
// }
60-
// });
61-
62-
// void it('connects using connected pool client', async () => {
63-
// const pool = new pg.Pool({ connectionString });
64-
// const poolClient = await pool.connect();
65-
66-
// try {
67-
// await insertDocumentUsingPongo(poolClient);
68-
// } finally {
69-
// poolClient.release();
70-
// await pool.end();
71-
// }
72-
// });
73-
74-
// void it('connects using connected client', async () => {
75-
// const client = new pg.Client({ connectionString });
76-
// await client.connect();
77-
78-
// try {
79-
// await insertDocumentUsingPongo(client);
80-
// } finally {
81-
// await client.end();
82-
// }
83-
// });
50+
void it('connects using pool', async () => {
51+
const pool = new pg.Pool({ connectionString });
52+
53+
try {
54+
await insertDocumentUsingPongo(pool);
55+
} catch (error) {
56+
console.log(error);
57+
} finally {
58+
await pool.end();
59+
}
60+
});
61+
62+
void it('connects using connected pool client', async () => {
63+
const pool = new pg.Pool({ connectionString });
64+
const poolClient = await pool.connect();
65+
66+
try {
67+
await insertDocumentUsingPongo(poolClient);
68+
} finally {
69+
poolClient.release();
70+
await pool.end();
71+
}
72+
});
73+
74+
void it('connects using connected client', async () => {
75+
const client = new pg.Client({ connectionString });
76+
await client.connect();
77+
78+
try {
79+
await insertDocumentUsingPongo(client);
80+
} finally {
81+
await client.end();
82+
}
83+
});
8484

8585
void it('connects using existing connection', async () => {
8686
const pool = dumbo({ connectionString });
@@ -101,20 +101,20 @@ void describe('Pongo collection', () => {
101101
}
102102
});
103103

104-
// void it('connects using existing connection from transaction', async () => {
105-
// const pool = dumbo({ connectionString });
106-
107-
// try {
108-
// await pool.withTransaction(async ({ connection }) => {
109-
// const pongo = pongoClient(connectionString, { connection });
110-
111-
// const users = pongo.db().collection<User>('connections');
112-
// await users.insertOne({ name: randomUUID() });
113-
// await users.insertOne({ name: randomUUID() });
114-
// });
115-
// } finally {
116-
// await pool.close();
117-
// }
118-
// });
104+
void it('connects using existing connection from transaction', async () => {
105+
const pool = dumbo({ connectionString });
106+
107+
try {
108+
await pool.withTransaction(async ({ connection }) => {
109+
const pongo = pongoClient(connectionString, { connection });
110+
111+
const users = pongo.db().collection<User>('connections');
112+
await users.insertOne({ name: randomUUID() });
113+
await users.insertOne({ name: randomUUID() });
114+
});
115+
} finally {
116+
await pool.close();
117+
}
118+
});
119119
});
120120
});

0 commit comments

Comments
 (0)