graphile-postgis 2.9.4 → 2.9.6
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/esm/plugins/connection-filter-operators.d.ts +1 -0
- package/esm/plugins/connection-filter-operators.js +5 -1
- package/esm/plugins/detect-extension.js +8 -4
- package/esm/plugins/within-distance-operator.d.ts +1 -0
- package/esm/plugins/within-distance-operator.js +5 -1
- package/esm/types.d.ts +3 -3
- package/package.json +5 -5
- package/plugins/connection-filter-operators.d.ts +1 -0
- package/plugins/connection-filter-operators.js +5 -1
- package/plugins/detect-extension.js +8 -4
- package/plugins/within-distance-operator.d.ts +1 -0
- package/plugins/within-distance-operator.js +5 -1
- package/types.d.ts +3 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import 'graphile-build';
|
|
2
|
+
import 'graphile-build-pg';
|
|
2
3
|
import 'graphile-connection-filter';
|
|
3
4
|
import sql from 'pg-sql2';
|
|
4
5
|
import { CONCRETE_SUBTYPES } from '../constants';
|
|
@@ -211,7 +212,10 @@ export function createPostgisOperatorFactory() {
|
|
|
211
212
|
geometry: [],
|
|
212
213
|
geography: []
|
|
213
214
|
};
|
|
214
|
-
const codecPairs = [
|
|
215
|
+
const codecPairs = [];
|
|
216
|
+
if (geometryCodec) {
|
|
217
|
+
codecPairs.push(['geometry', geometryCodec]);
|
|
218
|
+
}
|
|
215
219
|
if (geographyCodec) {
|
|
216
220
|
codecPairs.push(['geography', geographyCodec]);
|
|
217
221
|
}
|
|
@@ -34,12 +34,16 @@ export const PostgisExtensionDetectionPlugin = {
|
|
|
34
34
|
}
|
|
35
35
|
else if (pg.name === 'geography') {
|
|
36
36
|
geographyCodec = codec;
|
|
37
|
+
if (!geometryCodec) {
|
|
38
|
+
schemaName = pg.schemaName || 'public';
|
|
39
|
+
}
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
|
-
// PostGIS
|
|
40
|
-
//
|
|
41
|
-
//
|
|
42
|
-
|
|
42
|
+
// PostGIS is detected when at least one of geometry or geography
|
|
43
|
+
// codecs is present. Some databases use only geography columns
|
|
44
|
+
// (e.g. use_geography: true in DataPostGIS), so PostGraphile may
|
|
45
|
+
// introspect geography but not geometry.
|
|
46
|
+
if (!geometryCodec && !geographyCodec) {
|
|
43
47
|
return build;
|
|
44
48
|
}
|
|
45
49
|
const postgisInfo = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import 'graphile-build';
|
|
2
|
+
import 'graphile-build-pg';
|
|
2
3
|
import 'graphile-connection-filter';
|
|
3
4
|
import sql from 'pg-sql2';
|
|
4
5
|
import { CONCRETE_SUBTYPES } from '../constants';
|
|
@@ -44,7 +45,10 @@ export function createWithinDistanceOperatorFactory() {
|
|
|
44
45
|
geometry: [],
|
|
45
46
|
geography: []
|
|
46
47
|
};
|
|
47
|
-
const codecPairs = [
|
|
48
|
+
const codecPairs = [];
|
|
49
|
+
if (geometryCodec) {
|
|
50
|
+
codecPairs.push(['geometry', geometryCodec]);
|
|
51
|
+
}
|
|
48
52
|
if (geographyCodec) {
|
|
49
53
|
codecPairs.push(['geography', geographyCodec]);
|
|
50
54
|
}
|
package/esm/types.d.ts
CHANGED
|
@@ -20,9 +20,9 @@ export interface GisFieldValue {
|
|
|
20
20
|
export interface PostgisExtensionInfo {
|
|
21
21
|
/** The schema name where PostGIS is installed (e.g. 'public') */
|
|
22
22
|
schemaName: string;
|
|
23
|
-
/** The geometry codec from the registry */
|
|
24
|
-
geometryCodec: PgCodec;
|
|
25
|
-
/** The geography codec from the registry (
|
|
23
|
+
/** The geometry codec from the registry (null if only geography columns are used) */
|
|
24
|
+
geometryCodec: PgCodec | null;
|
|
25
|
+
/** The geography codec from the registry (null if only geometry columns are used) */
|
|
26
26
|
geographyCodec: PgCodec | null;
|
|
27
27
|
}
|
|
28
28
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphile-postgis",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.6",
|
|
4
4
|
"description": "PostGIS support for PostGraphile v5",
|
|
5
5
|
"author": "Constructive <developers@constructive.io>",
|
|
6
6
|
"homepage": "https://github.com/constructive-io/constructive",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"graphile-build": "5.0.0",
|
|
47
47
|
"graphile-build-pg": "5.0.0",
|
|
48
48
|
"graphile-config": "1.0.0",
|
|
49
|
-
"graphile-connection-filter": "^1.3.
|
|
49
|
+
"graphile-connection-filter": "^1.3.5",
|
|
50
50
|
"graphql": "16.13.0",
|
|
51
51
|
"pg-sql2": "5.0.0",
|
|
52
52
|
"postgraphile": "5.0.0"
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/geojson": "^7946.0.14",
|
|
61
61
|
"@types/node": "^22.19.11",
|
|
62
|
-
"graphile-test": "^4.7.
|
|
62
|
+
"graphile-test": "^4.7.5",
|
|
63
63
|
"makage": "^0.3.0",
|
|
64
|
-
"pgsql-test": "^4.7.
|
|
64
|
+
"pgsql-test": "^4.7.5"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "d0d8f5ca5828ad3efba5f607bc699a8d520e4603"
|
|
67
67
|
}
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createPostgisOperatorFactory = createPostgisOperatorFactory;
|
|
7
7
|
require("graphile-build");
|
|
8
|
+
require("graphile-build-pg");
|
|
8
9
|
require("graphile-connection-filter");
|
|
9
10
|
const pg_sql2_1 = __importDefault(require("pg-sql2"));
|
|
10
11
|
const constants_1 = require("../constants");
|
|
@@ -217,7 +218,10 @@ function createPostgisOperatorFactory() {
|
|
|
217
218
|
geometry: [],
|
|
218
219
|
geography: []
|
|
219
220
|
};
|
|
220
|
-
const codecPairs = [
|
|
221
|
+
const codecPairs = [];
|
|
222
|
+
if (geometryCodec) {
|
|
223
|
+
codecPairs.push(['geometry', geometryCodec]);
|
|
224
|
+
}
|
|
221
225
|
if (geographyCodec) {
|
|
222
226
|
codecPairs.push(['geography', geographyCodec]);
|
|
223
227
|
}
|
|
@@ -37,12 +37,16 @@ exports.PostgisExtensionDetectionPlugin = {
|
|
|
37
37
|
}
|
|
38
38
|
else if (pg.name === 'geography') {
|
|
39
39
|
geographyCodec = codec;
|
|
40
|
+
if (!geometryCodec) {
|
|
41
|
+
schemaName = pg.schemaName || 'public';
|
|
42
|
+
}
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
|
-
// PostGIS
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
|
|
45
|
+
// PostGIS is detected when at least one of geometry or geography
|
|
46
|
+
// codecs is present. Some databases use only geography columns
|
|
47
|
+
// (e.g. use_geography: true in DataPostGIS), so PostGraphile may
|
|
48
|
+
// introspect geography but not geometry.
|
|
49
|
+
if (!geometryCodec && !geographyCodec) {
|
|
46
50
|
return build;
|
|
47
51
|
}
|
|
48
52
|
const postgisInfo = {
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createWithinDistanceOperatorFactory = createWithinDistanceOperatorFactory;
|
|
7
7
|
require("graphile-build");
|
|
8
|
+
require("graphile-build-pg");
|
|
8
9
|
require("graphile-connection-filter");
|
|
9
10
|
const pg_sql2_1 = __importDefault(require("pg-sql2"));
|
|
10
11
|
const constants_1 = require("../constants");
|
|
@@ -50,7 +51,10 @@ function createWithinDistanceOperatorFactory() {
|
|
|
50
51
|
geometry: [],
|
|
51
52
|
geography: []
|
|
52
53
|
};
|
|
53
|
-
const codecPairs = [
|
|
54
|
+
const codecPairs = [];
|
|
55
|
+
if (geometryCodec) {
|
|
56
|
+
codecPairs.push(['geometry', geometryCodec]);
|
|
57
|
+
}
|
|
54
58
|
if (geographyCodec) {
|
|
55
59
|
codecPairs.push(['geography', geographyCodec]);
|
|
56
60
|
}
|
package/types.d.ts
CHANGED
|
@@ -20,9 +20,9 @@ export interface GisFieldValue {
|
|
|
20
20
|
export interface PostgisExtensionInfo {
|
|
21
21
|
/** The schema name where PostGIS is installed (e.g. 'public') */
|
|
22
22
|
schemaName: string;
|
|
23
|
-
/** The geometry codec from the registry */
|
|
24
|
-
geometryCodec: PgCodec;
|
|
25
|
-
/** The geography codec from the registry (
|
|
23
|
+
/** The geometry codec from the registry (null if only geography columns are used) */
|
|
24
|
+
geometryCodec: PgCodec | null;
|
|
25
|
+
/** The geography codec from the registry (null if only geometry columns are used) */
|
|
26
26
|
geographyCodec: PgCodec | null;
|
|
27
27
|
}
|
|
28
28
|
/**
|