Skip to content

Commit

Permalink
Bumped to 0.12.5
Browse files Browse the repository at this point in the history
  • Loading branch information
oskardudycz committed Aug 9, 2024
1 parent c15e238 commit 653f070
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 54 deletions.
6 changes: 3 additions & 3 deletions src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@event-driven-io/pongo-core",
"version": "0.12.4",
"version": "0.12.5",
"description": "Pongo - Mongo with strong consistency on top of Postgres",
"type": "module",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/pongo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@event-driven-io/pongo",
"version": "0.12.4",
"version": "0.12.5",
"description": "Pongo - Mongo with strong consistency on top of Postgres",
"type": "module",
"scripts": {
Expand Down
98 changes: 49 additions & 49 deletions src/packages/pongo/src/core/pongoClient.connections.int.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,40 +47,40 @@ void describe('Pongo collection', () => {
};

void describe('Pool', () => {
// void it('connects using pool', async () => {
// const pool = new pg.Pool({ connectionString });

// try {
// await insertDocumentUsingPongo(pool);
// } catch (error) {
// console.log(error);
// } finally {
// await pool.end();
// }
// });

// void it('connects using connected pool client', async () => {
// const pool = new pg.Pool({ connectionString });
// const poolClient = await pool.connect();

// try {
// await insertDocumentUsingPongo(poolClient);
// } finally {
// poolClient.release();
// await pool.end();
// }
// });

// void it('connects using connected client', async () => {
// const client = new pg.Client({ connectionString });
// await client.connect();

// try {
// await insertDocumentUsingPongo(client);
// } finally {
// await client.end();
// }
// });
void it('connects using pool', async () => {
const pool = new pg.Pool({ connectionString });

try {
await insertDocumentUsingPongo(pool);
} catch (error) {
console.log(error);
} finally {
await pool.end();
}
});

void it('connects using connected pool client', async () => {
const pool = new pg.Pool({ connectionString });
const poolClient = await pool.connect();

try {
await insertDocumentUsingPongo(poolClient);
} finally {
poolClient.release();
await pool.end();
}
});

void it('connects using connected client', async () => {
const client = new pg.Client({ connectionString });
await client.connect();

try {
await insertDocumentUsingPongo(client);
} finally {
await client.end();
}
});

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

// void it('connects using existing connection from transaction', async () => {
// const pool = dumbo({ connectionString });

// try {
// await pool.withTransaction(async ({ connection }) => {
// const pongo = pongoClient(connectionString, { connection });

// const users = pongo.db().collection<User>('connections');
// await users.insertOne({ name: randomUUID() });
// await users.insertOne({ name: randomUUID() });
// });
// } finally {
// await pool.close();
// }
// });
void it('connects using existing connection from transaction', async () => {
const pool = dumbo({ connectionString });

try {
await pool.withTransaction(async ({ connection }) => {
const pongo = pongoClient(connectionString, { connection });

const users = pongo.db().collection<User>('connections');
await users.insertOne({ name: randomUUID() });
await users.insertOne({ name: randomUUID() });
});
} finally {
await pool.close();
}
});
});
});

0 comments on commit 653f070

Please sign in to comment.