Skip to content

Commit

Permalink
Build deno [autogenerated commit]
Browse files Browse the repository at this point in the history
  • Loading branch information
oguimbal committed Dec 20, 2023
1 parent 75c3b65 commit 2d6ef49
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .deno/adapters/adapters.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LibAdapters, IMemoryDb, NotSupported, QueryResult, DataType } from '../interfaces.ts';
import { LibAdapters, IMemoryDb, NotSupported, QueryResult } from '../interfaces.ts';
import lru from 'https://deno.land/x/lru_cache@6.0.0-deno.4/mod.ts';
import { compareVersions } from '../utils.ts';
import { toLiteral } from '../misc/pg-utils.ts';
Expand Down Expand Up @@ -324,6 +324,16 @@ export class Adapters implements LibAdapters {
return knex;
}

createKysely(queryLatency?: number, kyselyConfig?: object): any {
const { Kysely, PostgresDialect } = __non_webpack_require__('kysely');
const pg = this.createPg(queryLatency);
return new Kysely({
...kyselyConfig,
dialect: new PostgresDialect({
pool: new pg.Pool(),
}),
});
}

async createMikroOrm(mikroOrmOptions: any, queryLatency?: number) {

Expand Down
3 changes: 3 additions & 0 deletions .deno/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ export interface LibAdapters {
/** Create a Knex.js instance bound to this db */
createKnex(queryLatency?: number, knexConfig?: object): any;

/** Create a Kysely instance bound to this db */
createKysely(queryLatency?: number, kyselyConfig?: object): any;

/** Create a mikro-orm instance bound to this db */
createMikroOrm(mikroOrmOptions: any, queryLatency?: number): Promise<any>
}
Expand Down
1 change: 1 addition & 0 deletions .deno/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ pg-mem provides handy shortcuts to create instances of popular libraries that wi
- slonik
- typeorm
- knex
- kysely
- mikro-orm

[See the wiki for more details](https://github.com/oguimbal/pg-mem/wiki/Libraries-adapters)
Expand Down

0 comments on commit 2d6ef49

Please sign in to comment.