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.d.ts +1 -0
- package/dist/index.js +16 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8168,6 +8168,7 @@ interface PostgisPoint {
|
|
|
8168
8168
|
declare class PostgisGeographyPointColumn<Schema extends ColumnSchemaConfig> extends ColumnType<Schema, PostgisPoint, ReturnType<Schema['geographyPointSchema']>, OperatorsAny> {
|
|
8169
8169
|
dataType: string;
|
|
8170
8170
|
operators: OperatorsAny;
|
|
8171
|
+
static encode: ({ srid, lon, lat, }: PostgisPoint) => string;
|
|
8171
8172
|
static isDefaultPoint(typmod: number): boolean;
|
|
8172
8173
|
constructor(schema: Schema);
|
|
8173
8174
|
toCode(ctx: ColumnToCodeCtx, key: string): Code;
|
package/dist/index.js
CHANGED
|
@@ -7191,6 +7191,21 @@ class DomainColumn extends CustomTypeColumn {
|
|
|
7191
7191
|
}
|
|
7192
7192
|
|
|
7193
7193
|
const defaultSrid = 4326;
|
|
7194
|
+
const defaultEncode = ({
|
|
7195
|
+
srid = defaultSrid,
|
|
7196
|
+
lon,
|
|
7197
|
+
lat
|
|
7198
|
+
}) => {
|
|
7199
|
+
const arr = new Uint8Array(25);
|
|
7200
|
+
const view = new DataView(arr.buffer);
|
|
7201
|
+
view.setInt8(0, 1);
|
|
7202
|
+
view.setInt8(1, 1);
|
|
7203
|
+
view.setInt8(4, 32);
|
|
7204
|
+
view.setUint32(5, srid, true);
|
|
7205
|
+
view.setFloat64(9, lon, true);
|
|
7206
|
+
view.setFloat64(17, lat, true);
|
|
7207
|
+
return uint8ArrToHex(arr);
|
|
7208
|
+
};
|
|
7194
7209
|
class PostgisGeographyPointColumn extends ColumnType {
|
|
7195
7210
|
constructor(schema) {
|
|
7196
7211
|
super(schema, schema.geographyPointSchema());
|
|
@@ -7206,6 +7221,7 @@ class PostgisGeographyPointColumn extends ColumnType {
|
|
|
7206
7221
|
return columnCode(this, ctx, key, `geography.point()`);
|
|
7207
7222
|
}
|
|
7208
7223
|
}
|
|
7224
|
+
PostgisGeographyPointColumn.encode = defaultEncode;
|
|
7209
7225
|
const defaultParse = (input) => {
|
|
7210
7226
|
const bytes = new Uint8Array(20);
|
|
7211
7227
|
for (let i = 0; i < 40; i += 2) {
|
|
@@ -7221,21 +7237,6 @@ const defaultParse = (input) => {
|
|
|
7221
7237
|
srid
|
|
7222
7238
|
};
|
|
7223
7239
|
};
|
|
7224
|
-
const defaultEncode = ({
|
|
7225
|
-
srid = defaultSrid,
|
|
7226
|
-
lon,
|
|
7227
|
-
lat
|
|
7228
|
-
}) => {
|
|
7229
|
-
const arr = new Uint8Array(25);
|
|
7230
|
-
const view = new DataView(arr.buffer);
|
|
7231
|
-
view.setInt8(0, 1);
|
|
7232
|
-
view.setInt8(1, 1);
|
|
7233
|
-
view.setInt8(4, 32);
|
|
7234
|
-
view.setUint32(5, srid, true);
|
|
7235
|
-
view.setFloat64(9, lon, true);
|
|
7236
|
-
view.setFloat64(17, lat, true);
|
|
7237
|
-
return uint8ArrToHex(arr);
|
|
7238
|
-
};
|
|
7239
7240
|
const typmodGetType = (typmod) => (typmod & 252) >> 2;
|
|
7240
7241
|
const lwtypeName = (type) => [
|
|
7241
7242
|
"Unknown",
|