pqb 0.2.4 → 0.2.5

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/index.d.ts CHANGED
@@ -690,7 +690,7 @@ declare class Adapter {
690
690
  query<T extends QueryResultRow = any>(query: QueryInput, types?: TypeParsers): Promise<QueryResult<T>>;
691
691
  arrays<R extends any[] = any[]>(query: QueryInput, types?: TypeParsers): Promise<QueryArraysResult<R>>;
692
692
  transaction<Result>(cb: (adapter: TransactionAdapter) => Promise<Result>): Promise<Result>;
693
- destroy(): Promise<void>;
693
+ close(): Promise<void>;
694
694
  }
695
695
  declare class TransactionAdapter implements Adapter {
696
696
  pool: Pool;
@@ -700,7 +700,7 @@ declare class TransactionAdapter implements Adapter {
700
700
  query<T extends QueryResultRow = any>(query: QueryInput, types?: TypeParsers): Promise<QueryResult<T>>;
701
701
  arrays<R extends any[] = any[]>(query: QueryInput, types?: TypeParsers): Promise<QueryArraysResult<R>>;
702
702
  transaction<Result>(cb: (adapter: TransactionAdapter) => Promise<Result>): Promise<Result>;
703
- destroy(): Promise<void>;
703
+ close(): Promise<void>;
704
704
  }
705
705
 
706
706
  declare type ThenResult<Res> = (resolve?: (value: Res) => any, reject?: (error: any) => any) => Promise<Res | never>;
@@ -878,7 +878,7 @@ declare class Db<Table extends string | undefined = undefined, Shape extends Col
878
878
  declare type DbResult<CT extends ColumnTypesBase> = Db & {
879
879
  <Table extends string, Shape extends ColumnsShape = ColumnsShape>(table: Table, shape?: ((t: CT) => Shape) | Shape, options?: DbTableOptions): Db<Table, Shape>;
880
880
  adapter: Adapter;
881
- destroy: Adapter['destroy'];
881
+ close: Adapter['close'];
882
882
  };
883
883
  declare type DbOptions<CT extends ColumnTypesBase = ColumnTypes> = ({
884
884
  adapter: Adapter;
package/dist/index.esm.js CHANGED
@@ -3013,7 +3013,7 @@ class Adapter {
3013
3013
  client.release();
3014
3014
  }
3015
3015
  }
3016
- destroy() {
3016
+ close() {
3017
3017
  return this.pool.end();
3018
3018
  }
3019
3019
  }
@@ -3055,7 +3055,7 @@ class TransactionAdapter {
3055
3055
  async transaction(cb) {
3056
3056
  return await cb(this);
3057
3057
  }
3058
- destroy() {
3058
+ close() {
3059
3059
  return this.pool.end();
3060
3060
  }
3061
3061
  }
@@ -5455,7 +5455,7 @@ const createDb = (_a) => {
5455
5455
  );
5456
5456
  },
5457
5457
  qb,
5458
- { adapter, destroy: () => adapter.destroy() }
5458
+ { adapter, close: () => adapter.close() }
5459
5459
  );
5460
5460
  Object.getOwnPropertyNames(Db.prototype).forEach((name) => {
5461
5461
  db[name] = Db.prototype[name];