pqb 0.42.3 → 0.42.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/index.mjs CHANGED
@@ -7189,6 +7189,21 @@ class DomainColumn extends CustomTypeColumn {
7189
7189
  }
7190
7190
 
7191
7191
  const defaultSrid = 4326;
7192
+ const defaultEncode = ({
7193
+ srid = defaultSrid,
7194
+ lon,
7195
+ lat
7196
+ }) => {
7197
+ const arr = new Uint8Array(25);
7198
+ const view = new DataView(arr.buffer);
7199
+ view.setInt8(0, 1);
7200
+ view.setInt8(1, 1);
7201
+ view.setInt8(4, 32);
7202
+ view.setUint32(5, srid, true);
7203
+ view.setFloat64(9, lon, true);
7204
+ view.setFloat64(17, lat, true);
7205
+ return uint8ArrToHex(arr);
7206
+ };
7192
7207
  class PostgisGeographyPointColumn extends ColumnType {
7193
7208
  constructor(schema) {
7194
7209
  super(schema, schema.geographyPointSchema());
@@ -7204,6 +7219,7 @@ class PostgisGeographyPointColumn extends ColumnType {
7204
7219
  return columnCode(this, ctx, key, `geography.point()`);
7205
7220
  }
7206
7221
  }
7222
+ PostgisGeographyPointColumn.encode = defaultEncode;
7207
7223
  const defaultParse = (input) => {
7208
7224
  const bytes = new Uint8Array(20);
7209
7225
  for (let i = 0; i < 40; i += 2) {
@@ -7219,21 +7235,6 @@ const defaultParse = (input) => {
7219
7235
  srid
7220
7236
  };
7221
7237
  };
7222
- const defaultEncode = ({
7223
- srid = defaultSrid,
7224
- lon,
7225
- lat
7226
- }) => {
7227
- const arr = new Uint8Array(25);
7228
- const view = new DataView(arr.buffer);
7229
- view.setInt8(0, 1);
7230
- view.setInt8(1, 1);
7231
- view.setInt8(4, 32);
7232
- view.setUint32(5, srid, true);
7233
- view.setFloat64(9, lon, true);
7234
- view.setFloat64(17, lat, true);
7235
- return uint8ArrToHex(arr);
7236
- };
7237
7238
  const typmodGetType = (typmod) => (typmod & 252) >> 2;
7238
7239
  const lwtypeName = (type) => [
7239
7240
  "Unknown",