@opengis/fastify-table 2.0.137 → 2.0.139
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/server/plugins/pg/funcs/getPG.d.ts.map +1 -1
- package/dist/server/plugins/pg/funcs/getPG.js +6 -1
- package/dist/server/plugins/table/funcs/getFilterSQL/index.d.ts +2 -1
- package/dist/server/plugins/table/funcs/getFilterSQL/index.d.ts.map +1 -1
- package/dist/server/plugins/table/funcs/getFilterSQL/index.js +5 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPG.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/pg/funcs/getPG.ts"],"names":[],"mappings":"AAQA,iBAAS,KAAK,CAAC,KAAK,GAAE,GAAQ,
|
|
1
|
+
{"version":3,"file":"getPG.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/pg/funcs/getPG.ts"],"names":[],"mappings":"AAQA,iBAAS,KAAK,CAAC,KAAK,GAAE,GAAQ,OA+D7B;AAOD,eAAe,KAAK,CAAC"}
|
|
@@ -21,13 +21,17 @@ function getPG(param = {}) {
|
|
|
21
21
|
"client";
|
|
22
22
|
if (pgClients[name])
|
|
23
23
|
return pgClients[name];
|
|
24
|
+
const statementTimeout = timeout ?? config.pg?.statement_timeout;
|
|
24
25
|
const dbConfig = {
|
|
26
|
+
name,
|
|
25
27
|
user: user || config.pg?.user || "postgres",
|
|
26
28
|
password: password || config.pg?.password || "postgres",
|
|
27
29
|
host: host || config.pg?.host,
|
|
28
30
|
port: port || config.pg?.port,
|
|
29
31
|
database: db || database || config.pg?.db || config.pg?.database,
|
|
30
|
-
statement_timeout:
|
|
32
|
+
statement_timeout: typeof statementTimeout === "boolean" && !statementTimeout
|
|
33
|
+
? false
|
|
34
|
+
: statementTimeout || 10000,
|
|
31
35
|
connectionTimeoutMillis: connectionTimeout || config.pg?.connectionTimeoutMillis || 5000,
|
|
32
36
|
};
|
|
33
37
|
if (!dbConfig.database) {
|
|
@@ -41,5 +45,6 @@ function getPG(param = {}) {
|
|
|
41
45
|
}
|
|
42
46
|
if (config.pg) {
|
|
43
47
|
getPG({ name: "client" });
|
|
48
|
+
getPG({ name: "stream", statement_timeout: false });
|
|
44
49
|
}
|
|
45
50
|
export default getPG;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type ExtendedPG } from "../../../../types/core.js";
|
|
2
|
-
export default function getFilterSQL({ table, filter, pg, search, filterList, query, custom, state, uid, objectId, order, }: {
|
|
2
|
+
export default function getFilterSQL({ table, filter, pg, search, searchColumn: searchColumn1, filterList, query, custom, state, uid, objectId, order, }: {
|
|
3
3
|
table: string | undefined;
|
|
4
4
|
filter?: string;
|
|
5
5
|
pg: ExtendedPG;
|
|
6
6
|
search?: string;
|
|
7
|
+
searchColumn?: string;
|
|
7
8
|
filterList?: any[];
|
|
8
9
|
query?: string;
|
|
9
10
|
custom?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../server/plugins/table/funcs/getFilterSQL/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAsC5D,wBAA8B,YAAY,CAAC,EACzC,KAAK,EACL,MAAM,EACN,EAAqB,EACrB,MAAM,EACN,UAAU,EACV,KAAK,EACL,MAAM,EACN,KAAK,EACL,GAAG,EACH,QAAQ,EACR,KAAK,GACN,EAAE;IACD,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,UAAU,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../server/plugins/table/funcs/getFilterSQL/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAsC5D,wBAA8B,YAAY,CAAC,EACzC,KAAK,EACL,MAAM,EACN,EAAqB,EACrB,MAAM,EACN,YAAY,EAAE,aAAa,EAC3B,UAAU,EACV,KAAK,EACL,MAAM,EACN,KAAK,EACL,GAAG,EACH,QAAQ,EACR,KAAK,GACN,EAAE;IACD,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,UAAU,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;;;;;;;;;;;;;;;;;;;;;;;;GAsPA"}
|
|
@@ -20,7 +20,7 @@ function getExtraQuery(mainColumns, schema, table, pk) {
|
|
|
20
20
|
extraColumns,
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
export default async function getFilterSQL({ table, filter, pg = pgClients.client, search, filterList, query, custom, state, uid, objectId, order, }) {
|
|
23
|
+
export default async function getFilterSQL({ table, filter, pg = pgClients.client, search, searchColumn: searchColumn1, filterList, query, custom, state, uid, objectId, order, }) {
|
|
24
24
|
if (!table)
|
|
25
25
|
return { error: "param table is required", status: 400 };
|
|
26
26
|
const body = await getTemplate("table", table);
|
|
@@ -79,7 +79,10 @@ export default async function getFilterSQL({ table, filter, pg = pgClients.clien
|
|
|
79
79
|
?.filter((el) => pg.pgType?.[el.dataTypeID] === "text")
|
|
80
80
|
?.map((el) => `"${el.name}"`)
|
|
81
81
|
.join(",");
|
|
82
|
-
const searchColumn =
|
|
82
|
+
const searchColumn = searchColumn1 ||
|
|
83
|
+
body?.search_column ||
|
|
84
|
+
body?.meta?.search ||
|
|
85
|
+
autoSearchColumn;
|
|
83
86
|
const fieldsList = (fieldsModel || fields)?.map((el) => el.name);
|
|
84
87
|
try {
|
|
85
88
|
const tableSQL = await getTableSql({
|