pqb 0.7.7 → 0.7.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # pqb
2
2
 
3
+ ## 0.7.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Change connectionString to databaseURL option, add ssl option
8
+
3
9
  ## 0.7.7
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -180,8 +180,9 @@ declare type QueryArraysResult<R extends any[] = any[]> = {
180
180
  name: string;
181
181
  }[];
182
182
  };
183
- declare type AdapterOptions = Omit<PoolConfig, 'types'> & {
183
+ declare type AdapterOptions = Omit<PoolConfig, 'types' | 'connectionString'> & {
184
184
  types?: TypeParsers;
185
+ databaseURL?: string;
185
186
  };
186
187
  declare class Adapter {
187
188
  types: TypeParsers;
package/dist/index.esm.js CHANGED
@@ -3204,6 +3204,13 @@ class Adapter {
3204
3204
  constructor(_a) {
3205
3205
  var _b = _a, { types: types2 = defaultTypeParsers } = _b, config = __objRest$1(_b, ["types"]);
3206
3206
  this.types = types2;
3207
+ if (config.databaseURL) {
3208
+ config.connectionString = config.databaseURL;
3209
+ const url = new URL(config.databaseURL);
3210
+ if (url.searchParams.get("ssl") === "true") {
3211
+ config.ssl = true;
3212
+ }
3213
+ }
3207
3214
  this.pool = new Pool(config);
3208
3215
  }
3209
3216
  async query(query, types2) {