@event-driven-io/pongo 0.17.0-beta.34 → 0.17.0-beta.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/cli.cjs +311 -494
  2. package/dist/cli.cjs.map +1 -1
  3. package/dist/cli.d.cts +4 -4
  4. package/dist/cli.d.ts +4 -3
  5. package/dist/cli.js +279 -494
  6. package/dist/cli.js.map +1 -1
  7. package/dist/cloudflare.cjs +36 -48
  8. package/dist/cloudflare.cjs.map +1 -1
  9. package/dist/cloudflare.d.cts +7 -7
  10. package/dist/cloudflare.d.ts +7 -7
  11. package/dist/cloudflare.js +29 -47
  12. package/dist/cloudflare.js.map +1 -1
  13. package/dist/core-CwxxuUAn.cjs +1590 -0
  14. package/dist/core-CwxxuUAn.cjs.map +1 -0
  15. package/dist/core-D_iZiiYe.js +1308 -0
  16. package/dist/core-D_iZiiYe.js.map +1 -0
  17. package/dist/core-DwoTLYbR.cjs +319 -0
  18. package/dist/core-DwoTLYbR.cjs.map +1 -0
  19. package/dist/core-fsJmsQDa.js +307 -0
  20. package/dist/core-fsJmsQDa.js.map +1 -0
  21. package/dist/index-DMq6F3x9.d.ts +705 -0
  22. package/dist/index-Du_IHXAj.d.ts +10 -0
  23. package/dist/index-ZKOB86ub.d.cts +10 -0
  24. package/dist/index-qeC-p0Tq.d.cts +705 -0
  25. package/dist/index.cjs +61 -118
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +11 -130
  28. package/dist/index.d.ts +11 -130
  29. package/dist/index.js +14 -119
  30. package/dist/index.js.map +1 -1
  31. package/dist/pg.cjs +214 -320
  32. package/dist/pg.cjs.map +1 -1
  33. package/dist/pg.d.cts +24 -22
  34. package/dist/pg.d.ts +24 -22
  35. package/dist/pg.js +209 -321
  36. package/dist/pg.js.map +1 -1
  37. package/dist/shim.cjs +281 -367
  38. package/dist/shim.cjs.map +1 -1
  39. package/dist/shim.d.cts +140 -137
  40. package/dist/shim.d.ts +140 -137
  41. package/dist/shim.js +275 -366
  42. package/dist/shim.js.map +1 -1
  43. package/dist/sqlite3.cjs +41 -56
  44. package/dist/sqlite3.cjs.map +1 -1
  45. package/dist/sqlite3.d.cts +9 -9
  46. package/dist/sqlite3.d.ts +9 -9
  47. package/dist/sqlite3.js +35 -56
  48. package/dist/sqlite3.js.map +1 -1
  49. package/package.json +15 -15
  50. package/dist/chunk-OJVG4KXA.js +0 -399
  51. package/dist/chunk-OJVG4KXA.js.map +0 -1
  52. package/dist/chunk-TYTEQJBC.cjs +0 -1583
  53. package/dist/chunk-TYTEQJBC.cjs.map +0 -1
  54. package/dist/chunk-U4NNEXNH.js +0 -1583
  55. package/dist/chunk-U4NNEXNH.js.map +0 -1
  56. package/dist/chunk-UP6HTRMM.cjs +0 -399
  57. package/dist/chunk-UP6HTRMM.cjs.map +0 -1
  58. package/dist/index-DHszkVjP.d.ts +0 -8
  59. package/dist/index-DLDCIBgH.d.cts +0 -8
  60. package/dist/pongoTransactionCache-BsigBOq1.d.cts +0 -556
  61. package/dist/pongoTransactionCache-BsigBOq1.d.ts +0 -556
package/dist/shim.js CHANGED
@@ -1,380 +1,289 @@
1
- import {
2
- pongoClient,
3
- pongoSession
4
- } from "./chunk-U4NNEXNH.js";
1
+ import { o as pongoClient, s as pongoSession } from "./core-D_iZiiYe.js";
2
+ import { parseConnectionString, toDatabaseDriverType } from "@event-driven-io/dumbo";
5
3
 
6
- // src/mongo/findCursor.ts
4
+ //#region src/mongo/findCursor.ts
7
5
  var FindCursor = class {
8
- findDocumentsPromise;
9
- documents = null;
10
- index = 0;
11
- constructor(documents) {
12
- this.findDocumentsPromise = documents;
13
- }
14
- async toArray() {
15
- return this.findDocuments();
16
- }
17
- async forEach(callback) {
18
- const docs = await this.findDocuments();
19
- for (const doc of docs) {
20
- callback(doc);
21
- }
22
- return Promise.resolve();
23
- }
24
- hasNext() {
25
- if (this.documents === null) throw Error("Error while fetching documents");
26
- return this.index < this.documents.length;
27
- }
28
- async next() {
29
- const docs = await this.findDocuments();
30
- return this.hasNext() ? docs[this.index++] ?? null : null;
31
- }
32
- async findDocuments() {
33
- this.documents = await this.findDocumentsPromise;
34
- return this.documents;
35
- }
6
+ findDocumentsPromise;
7
+ documents = null;
8
+ index = 0;
9
+ constructor(documents) {
10
+ this.findDocumentsPromise = documents;
11
+ }
12
+ async toArray() {
13
+ return this.findDocuments();
14
+ }
15
+ async forEach(callback) {
16
+ const docs = await this.findDocuments();
17
+ for (const doc of docs) callback(doc);
18
+ return Promise.resolve();
19
+ }
20
+ hasNext() {
21
+ if (this.documents === null) throw Error("Error while fetching documents");
22
+ return this.index < this.documents.length;
23
+ }
24
+ async next() {
25
+ const docs = await this.findDocuments();
26
+ return this.hasNext() ? docs[this.index++] ?? null : null;
27
+ }
28
+ async findDocuments() {
29
+ this.documents = await this.findDocumentsPromise;
30
+ return this.documents;
31
+ }
36
32
  };
37
33
 
38
- // src/mongo/mongoClient.ts
39
- import {
40
- parseConnectionString,
41
- toDatabaseDriverType
42
- } from "@event-driven-io/dumbo";
43
-
44
- // src/mongo/mongoCollection.ts
45
- var toCollectionOperationOptions = (options) => options?.session ? { session: options.session } : void 0;
46
- var toFindOptions = (options) => {
47
- if (!options?.session && !options?.limit && !options?.skip) {
48
- return void 0;
49
- }
50
- const pongoFindOptions = {};
51
- if (options?.session) {
52
- pongoFindOptions.session = options.session;
53
- }
54
- if (options?.limit !== void 0) {
55
- pongoFindOptions.limit = options.limit;
56
- }
57
- if (options?.skip !== void 0) {
58
- pongoFindOptions.skip = options.skip;
59
- }
60
- return pongoFindOptions;
34
+ //#endregion
35
+ //#region src/mongo/mongoCollection.ts
36
+ const toCollectionOperationOptions = (options) => options?.session ? { session: options.session } : void 0;
37
+ const toFindOptions = (options) => {
38
+ if (!options?.session && !options?.limit && !options?.skip && !options?.sort) return;
39
+ const pongoFindOptions = {};
40
+ if (options?.session) pongoFindOptions.session = options.session;
41
+ if (options?.limit !== void 0) pongoFindOptions.limit = options.limit;
42
+ if (options?.skip !== void 0) pongoFindOptions.skip = options.skip;
43
+ if (options?.sort !== void 0) pongoFindOptions.sort = options.sort;
44
+ return pongoFindOptions;
61
45
  };
62
46
  var Collection = class {
63
- collection;
64
- database;
65
- constructor(database, collection) {
66
- this.collection = collection;
67
- this.database = database;
68
- }
69
- get db() {
70
- return this.database;
71
- }
72
- get dbName() {
73
- return this.collection.dbName;
74
- }
75
- get collectionName() {
76
- return this.collection.collectionName;
77
- }
78
- get namespace() {
79
- return `${this.dbName}.${this.collectionName}`;
80
- }
81
- get readConcern() {
82
- return void 0;
83
- }
84
- get readPreference() {
85
- return void 0;
86
- }
87
- get bsonOptions() {
88
- return {};
89
- }
90
- get writeConcern() {
91
- return void 0;
92
- }
93
- get hint() {
94
- return void 0;
95
- }
96
- get timeoutMS() {
97
- return void 0;
98
- }
99
- set hint(v) {
100
- throw new Error("Method not implemented.");
101
- }
102
- async insertOne(doc, options) {
103
- const result = await this.collection.insertOne(
104
- doc,
105
- toCollectionOperationOptions(options)
106
- );
107
- return {
108
- acknowledged: result.acknowledged,
109
- insertedId: result.insertedId
110
- };
111
- }
112
- async insertMany(docs, options) {
113
- const result = await this.collection.insertMany(
114
- docs,
115
- toCollectionOperationOptions(options)
116
- );
117
- return {
118
- acknowledged: result.acknowledged,
119
- insertedIds: result.insertedIds,
120
- insertedCount: result.insertedCount
121
- };
122
- }
123
- bulkWrite(_operations, _options) {
124
- throw new Error("Method not implemented.");
125
- }
126
- async updateOne(filter, update, options) {
127
- const result = await this.collection.updateOne(
128
- filter,
129
- update,
130
- toCollectionOperationOptions(options)
131
- );
132
- return {
133
- acknowledged: result.acknowledged,
134
- matchedCount: result.modifiedCount,
135
- modifiedCount: result.modifiedCount,
136
- upsertedCount: result.modifiedCount,
137
- upsertedId: null
138
- };
139
- }
140
- replaceOne(filter, document, options) {
141
- return this.collection.replaceOne(
142
- filter,
143
- document,
144
- toCollectionOperationOptions(options)
145
- );
146
- }
147
- async updateMany(filter, update, options) {
148
- const result = await this.collection.updateMany(
149
- filter,
150
- update,
151
- toCollectionOperationOptions(options)
152
- );
153
- return {
154
- acknowledged: result.acknowledged,
155
- matchedCount: result.modifiedCount,
156
- modifiedCount: result.modifiedCount,
157
- upsertedCount: result.modifiedCount,
158
- upsertedId: null
159
- };
160
- }
161
- async deleteOne(filter, options) {
162
- const result = await this.collection.deleteOne(
163
- filter,
164
- toCollectionOperationOptions(options)
165
- );
166
- return {
167
- acknowledged: result.acknowledged,
168
- deletedCount: result.deletedCount
169
- };
170
- }
171
- async deleteMany(filter, options) {
172
- const result = await this.collection.deleteMany(
173
- filter,
174
- toCollectionOperationOptions(options)
175
- );
176
- return {
177
- acknowledged: result.acknowledged,
178
- deletedCount: result.deletedCount
179
- };
180
- }
181
- async rename(newName, options) {
182
- await this.collection.rename(
183
- newName,
184
- toCollectionOperationOptions(options)
185
- );
186
- return this;
187
- }
188
- drop(options) {
189
- return this.collection.drop(toCollectionOperationOptions(options));
190
- }
191
- async findOne(filter, options) {
192
- return await this.collection.findOne(
193
- filter,
194
- toCollectionOperationOptions(options)
195
- );
196
- }
197
- find(filter, options) {
198
- return new FindCursor(
199
- this.collection.find(filter, toFindOptions(options))
200
- );
201
- }
202
- options(_options) {
203
- throw new Error("Method not implemented.");
204
- }
205
- isCapped(_options) {
206
- throw new Error("Method not implemented.");
207
- }
208
- createIndex(_indexSpec, _options) {
209
- throw new Error("Method not implemented.");
210
- }
211
- createIndexes(_indexSpecs, _options) {
212
- throw new Error("Method not implemented.");
213
- }
214
- dropIndex(_indexName, _options) {
215
- throw new Error("Method not implemented.");
216
- }
217
- dropIndexes(_options) {
218
- throw new Error("Method not implemented.");
219
- }
220
- listIndexes(_options) {
221
- throw new Error("Method not implemented.");
222
- }
223
- indexExists(_indexes, _options) {
224
- throw new Error("Method not implemented.");
225
- }
226
- indexInformation(_options) {
227
- throw new Error("Method not implemented.");
228
- }
229
- estimatedDocumentCount(options) {
230
- return this.collection.countDocuments(
231
- {},
232
- toCollectionOperationOptions(options)
233
- );
234
- }
235
- countDocuments(filter, options) {
236
- return this.collection.countDocuments(
237
- filter,
238
- toCollectionOperationOptions(options)
239
- );
240
- }
241
- distinct(_key, _filter, _options) {
242
- throw new Error("Method not implemented.");
243
- }
244
- indexes(_options) {
245
- throw new Error("Method not implemented.");
246
- }
247
- findOneAndDelete(filter, options) {
248
- return this.collection.findOneAndDelete(
249
- filter,
250
- toCollectionOperationOptions(options)
251
- );
252
- }
253
- findOneAndReplace(filter, replacement, options) {
254
- return this.collection.findOneAndReplace(
255
- filter,
256
- replacement,
257
- toCollectionOperationOptions(options)
258
- );
259
- }
260
- findOneAndUpdate(filter, update, options) {
261
- return this.collection.findOneAndUpdate(
262
- filter,
263
- update,
264
- toCollectionOperationOptions(options)
265
- );
266
- }
267
- aggregate(_pipeline, _options) {
268
- throw new Error("Method not implemented.");
269
- }
270
- watch(_pipeline, _options) {
271
- throw new Error("Method not implemented.");
272
- }
273
- initializeUnorderedBulkOp(_options) {
274
- throw new Error("Method not implemented.");
275
- }
276
- initializeOrderedBulkOp(_options) {
277
- throw new Error("Method not implemented.");
278
- }
279
- count(filter, options) {
280
- return this.collection.countDocuments(
281
- filter ?? {},
282
- toCollectionOperationOptions(options)
283
- );
284
- }
285
- listSearchIndexes(_name, _options) {
286
- throw new Error("Method not implemented.");
287
- }
288
- createSearchIndex(_description) {
289
- throw new Error("Method not implemented.");
290
- }
291
- createSearchIndexes(_descriptions) {
292
- throw new Error("Method not implemented.");
293
- }
294
- dropSearchIndex(_name) {
295
- throw new Error("Method not implemented.");
296
- }
297
- updateSearchIndex(_name, _definition) {
298
- throw new Error("Method not implemented.");
299
- }
300
- async createCollection() {
301
- await this.collection.createCollection();
302
- }
303
- async handle(id, handle, options) {
304
- return this.collection.handle(id.toString(), handle, options);
305
- }
47
+ collection;
48
+ database;
49
+ constructor(database, collection) {
50
+ this.collection = collection;
51
+ this.database = database;
52
+ }
53
+ get db() {
54
+ return this.database;
55
+ }
56
+ get dbName() {
57
+ return this.collection.dbName;
58
+ }
59
+ get collectionName() {
60
+ return this.collection.collectionName;
61
+ }
62
+ get namespace() {
63
+ return `${this.dbName}.${this.collectionName}`;
64
+ }
65
+ get readConcern() {}
66
+ get readPreference() {}
67
+ get bsonOptions() {
68
+ return {};
69
+ }
70
+ get writeConcern() {}
71
+ get hint() {}
72
+ get timeoutMS() {}
73
+ set hint(v) {
74
+ throw new Error("Method not implemented.");
75
+ }
76
+ async insertOne(doc, options) {
77
+ const result = await this.collection.insertOne(doc, toCollectionOperationOptions(options));
78
+ return {
79
+ acknowledged: result.acknowledged,
80
+ insertedId: result.insertedId
81
+ };
82
+ }
83
+ async insertMany(docs, options) {
84
+ const result = await this.collection.insertMany(docs, toCollectionOperationOptions(options));
85
+ return {
86
+ acknowledged: result.acknowledged,
87
+ insertedIds: result.insertedIds,
88
+ insertedCount: result.insertedCount
89
+ };
90
+ }
91
+ bulkWrite(_operations, _options) {
92
+ throw new Error("Method not implemented.");
93
+ }
94
+ async updateOne(filter, update, options) {
95
+ const result = await this.collection.updateOne(filter, update, toCollectionOperationOptions(options));
96
+ return {
97
+ acknowledged: result.acknowledged,
98
+ matchedCount: result.modifiedCount,
99
+ modifiedCount: result.modifiedCount,
100
+ upsertedCount: result.modifiedCount,
101
+ upsertedId: null
102
+ };
103
+ }
104
+ replaceOne(filter, document, options) {
105
+ return this.collection.replaceOne(filter, document, toCollectionOperationOptions(options));
106
+ }
107
+ async updateMany(filter, update, options) {
108
+ const result = await this.collection.updateMany(filter, update, toCollectionOperationOptions(options));
109
+ return {
110
+ acknowledged: result.acknowledged,
111
+ matchedCount: result.modifiedCount,
112
+ modifiedCount: result.modifiedCount,
113
+ upsertedCount: result.modifiedCount,
114
+ upsertedId: null
115
+ };
116
+ }
117
+ async deleteOne(filter, options) {
118
+ const result = await this.collection.deleteOne(filter, toCollectionOperationOptions(options));
119
+ return {
120
+ acknowledged: result.acknowledged,
121
+ deletedCount: result.deletedCount
122
+ };
123
+ }
124
+ async deleteMany(filter, options) {
125
+ const result = await this.collection.deleteMany(filter, toCollectionOperationOptions(options));
126
+ return {
127
+ acknowledged: result.acknowledged,
128
+ deletedCount: result.deletedCount
129
+ };
130
+ }
131
+ async rename(newName, options) {
132
+ await this.collection.rename(newName, toCollectionOperationOptions(options));
133
+ return this;
134
+ }
135
+ drop(options) {
136
+ return this.collection.drop(toCollectionOperationOptions(options));
137
+ }
138
+ async findOne(filter, options) {
139
+ return await this.collection.findOne(filter, toCollectionOperationOptions(options));
140
+ }
141
+ find(filter, options) {
142
+ return new FindCursor(this.collection.find(filter, toFindOptions(options)));
143
+ }
144
+ options(_options) {
145
+ throw new Error("Method not implemented.");
146
+ }
147
+ isCapped(_options) {
148
+ throw new Error("Method not implemented.");
149
+ }
150
+ createIndex(_indexSpec, _options) {
151
+ throw new Error("Method not implemented.");
152
+ }
153
+ createIndexes(_indexSpecs, _options) {
154
+ throw new Error("Method not implemented.");
155
+ }
156
+ dropIndex(_indexName, _options) {
157
+ throw new Error("Method not implemented.");
158
+ }
159
+ dropIndexes(_options) {
160
+ throw new Error("Method not implemented.");
161
+ }
162
+ listIndexes(_options) {
163
+ throw new Error("Method not implemented.");
164
+ }
165
+ indexExists(_indexes, _options) {
166
+ throw new Error("Method not implemented.");
167
+ }
168
+ indexInformation(_options) {
169
+ throw new Error("Method not implemented.");
170
+ }
171
+ estimatedDocumentCount(options) {
172
+ return this.collection.countDocuments({}, toCollectionOperationOptions(options));
173
+ }
174
+ countDocuments(filter, options) {
175
+ return this.collection.countDocuments(filter, toCollectionOperationOptions(options));
176
+ }
177
+ distinct(_key, _filter, _options) {
178
+ throw new Error("Method not implemented.");
179
+ }
180
+ indexes(_options) {
181
+ throw new Error("Method not implemented.");
182
+ }
183
+ findOneAndDelete(filter, options) {
184
+ return this.collection.findOneAndDelete(filter, toCollectionOperationOptions(options));
185
+ }
186
+ findOneAndReplace(filter, replacement, options) {
187
+ return this.collection.findOneAndReplace(filter, replacement, toCollectionOperationOptions(options));
188
+ }
189
+ findOneAndUpdate(filter, update, options) {
190
+ return this.collection.findOneAndUpdate(filter, update, toCollectionOperationOptions(options));
191
+ }
192
+ aggregate(_pipeline, _options) {
193
+ throw new Error("Method not implemented.");
194
+ }
195
+ watch(_pipeline, _options) {
196
+ throw new Error("Method not implemented.");
197
+ }
198
+ initializeUnorderedBulkOp(_options) {
199
+ throw new Error("Method not implemented.");
200
+ }
201
+ initializeOrderedBulkOp(_options) {
202
+ throw new Error("Method not implemented.");
203
+ }
204
+ count(filter, options) {
205
+ return this.collection.countDocuments(filter ?? {}, toCollectionOperationOptions(options));
206
+ }
207
+ listSearchIndexes(_name, _options) {
208
+ throw new Error("Method not implemented.");
209
+ }
210
+ createSearchIndex(_description) {
211
+ throw new Error("Method not implemented.");
212
+ }
213
+ createSearchIndexes(_descriptions) {
214
+ throw new Error("Method not implemented.");
215
+ }
216
+ dropSearchIndex(_name) {
217
+ throw new Error("Method not implemented.");
218
+ }
219
+ updateSearchIndex(_name, _definition) {
220
+ throw new Error("Method not implemented.");
221
+ }
222
+ async createCollection() {
223
+ await this.collection.createCollection();
224
+ }
225
+ async handle(id, handle, options) {
226
+ return this.collection.handle(id.toString(), handle, options);
227
+ }
306
228
  };
307
229
 
308
- // src/mongo/mongoDb.ts
230
+ //#endregion
231
+ //#region src/mongo/mongoDb.ts
309
232
  var Db = class {
310
- pongoDb;
311
- constructor(pongoDb) {
312
- this.pongoDb = pongoDb;
313
- }
314
- get databaseName() {
315
- return this.pongoDb.databaseName;
316
- }
317
- collection(collectionName, options) {
318
- return new Collection(
319
- this,
320
- this.pongoDb.collection(collectionName, options)
321
- );
322
- }
233
+ pongoDb;
234
+ constructor(pongoDb) {
235
+ this.pongoDb = pongoDb;
236
+ }
237
+ get databaseName() {
238
+ return this.pongoDb.databaseName;
239
+ }
240
+ collection(collectionName, options) {
241
+ return new Collection(this, this.pongoDb.collection(collectionName, options));
242
+ }
323
243
  };
324
244
 
325
- // src/mongo/mongoClient.ts
245
+ //#endregion
246
+ //#region src/mongo/mongoClient.ts
326
247
  var MongoClient = class {
327
- pongoClient;
328
- constructor(connectionStringOrOptions, options) {
329
- if (typeof connectionStringOrOptions !== "string") {
330
- this.pongoClient = pongoClient(connectionStringOrOptions);
331
- return;
332
- }
333
- const { databaseType, driverName } = parseConnectionString(
334
- connectionStringOrOptions
335
- );
336
- const driver = options?.driver ?? pongoDriverRegistry.tryGet(
337
- toDatabaseDriverType(databaseType, driverName)
338
- );
339
- if (driver === null) {
340
- throw new Error(
341
- `No database driver registered for ${databaseType} with name ${driverName}`
342
- );
343
- }
344
- this.pongoClient = pongoClient({
345
- ...options ?? {},
346
- ...{ connectionString: connectionStringOrOptions },
347
- driver
348
- });
349
- }
350
- async connect() {
351
- await this.pongoClient.connect();
352
- return this;
353
- }
354
- async close() {
355
- await this.pongoClient.close();
356
- }
357
- db(dbName) {
358
- return new Db(this.pongoClient.db(dbName));
359
- }
360
- startSession(_options) {
361
- return pongoSession();
362
- }
363
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
364
- async withSession(optionsOrExecutor, executor) {
365
- const callback = typeof optionsOrExecutor === "function" ? optionsOrExecutor : executor;
366
- const session = pongoSession();
367
- try {
368
- return await callback(session);
369
- } finally {
370
- await session.endSession();
371
- }
372
- }
373
- };
374
- export {
375
- Collection,
376
- Db,
377
- FindCursor,
378
- MongoClient
248
+ pongoClient;
249
+ constructor(connectionStringOrOptions, options) {
250
+ if (typeof connectionStringOrOptions !== "string") {
251
+ this.pongoClient = pongoClient(connectionStringOrOptions);
252
+ return;
253
+ }
254
+ const { databaseType, driverName } = parseConnectionString(connectionStringOrOptions);
255
+ const driver = options?.driver ?? pongoDriverRegistry.tryGet(toDatabaseDriverType(databaseType, driverName));
256
+ if (driver === null) throw new Error(`No database driver registered for ${databaseType} with name ${driverName}`);
257
+ this.pongoClient = pongoClient({
258
+ ...options ?? {},
259
+ connectionString: connectionStringOrOptions,
260
+ driver
261
+ });
262
+ }
263
+ async connect() {
264
+ await this.pongoClient.connect();
265
+ return this;
266
+ }
267
+ async close() {
268
+ await this.pongoClient.close();
269
+ }
270
+ db(dbName) {
271
+ return new Db(this.pongoClient.db(dbName));
272
+ }
273
+ startSession(_options) {
274
+ return pongoSession();
275
+ }
276
+ async withSession(optionsOrExecutor, executor) {
277
+ const callback = typeof optionsOrExecutor === "function" ? optionsOrExecutor : executor;
278
+ const session = pongoSession();
279
+ try {
280
+ return await callback(session);
281
+ } finally {
282
+ await session.endSession();
283
+ }
284
+ }
379
285
  };
286
+
287
+ //#endregion
288
+ export { Collection, Db, FindCursor, MongoClient };
380
289
  //# sourceMappingURL=shim.js.map