@geekmidas/db 0.0.2 → 0.0.4

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.
package/dist/kysely.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ControlledTransaction, Kysely, Transaction } from "kysely";
2
2
 
3
3
  //#region src/kysely.d.ts
4
- declare function withTransaction<T>(db: DatabaseConnection<any>, cb: (trx: DatabaseConnection<any>) => Promise<T>): Promise<T>;
4
+ declare function withTransaction<DB, T>(db: DatabaseConnection<DB>, cb: (trx: Transaction<DB>) => Promise<T>): Promise<T>;
5
5
  type DatabaseConnection<T> = ControlledTransaction<T> | Kysely<T> | Transaction<T>;
6
6
  //#endregion
7
7
  export { DatabaseConnection, withTransaction };
package/dist/kysely.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ControlledTransaction, Kysely, Transaction } from "kysely";
2
2
 
3
3
  //#region src/kysely.d.ts
4
- declare function withTransaction<T>(db: DatabaseConnection<any>, cb: (trx: DatabaseConnection<any>) => Promise<T>): Promise<T>;
4
+ declare function withTransaction<DB, T>(db: DatabaseConnection<DB>, cb: (trx: Transaction<DB>) => Promise<T>): Promise<T>;
5
5
  type DatabaseConnection<T> = ControlledTransaction<T> | Kysely<T> | Transaction<T>;
6
6
  //#endregion
7
7
  export { DatabaseConnection, withTransaction };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/db",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
package/src/kysely.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { ControlledTransaction, Kysely, Transaction } from 'kysely';
2
2
 
3
- export function withTransaction<DB extends DatabaseConnection<any>, T>(
4
- db: DB,
3
+ export function withTransaction<DB, T>(
4
+ db: DatabaseConnection<DB>,
5
5
  cb: (trx: Transaction<DB>) => Promise<T>,
6
6
  ): Promise<T> {
7
7
  if (db.isTransaction) {