prostgles-server 3.0.36 → 3.0.37

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.
Files changed (50) hide show
  1. package/dist/DboBuilder.d.ts.map +1 -1
  2. package/dist/DboBuilder.js +9 -17
  3. package/dist/DboBuilder.js.map +1 -1
  4. package/dist/Filtering.d.ts.map +1 -1
  5. package/dist/Filtering.js +11 -2
  6. package/dist/Filtering.js.map +1 -1
  7. package/dist/PostgresNotifListenManager.d.ts +1 -1
  8. package/dist/PostgresNotifListenManager.d.ts.map +1 -1
  9. package/dist/PostgresNotifListenManager.js.map +1 -1
  10. package/dist/Prostgles.d.ts +3 -1
  11. package/dist/Prostgles.d.ts.map +1 -1
  12. package/dist/Prostgles.js +2 -5
  13. package/dist/Prostgles.js.map +1 -1
  14. package/dist/PubSubManager.d.ts +5 -0
  15. package/dist/PubSubManager.d.ts.map +1 -1
  16. package/dist/PubSubManager.js +27 -16
  17. package/dist/PubSubManager.js.map +1 -1
  18. package/dist/SchemaWatch.d.ts +13 -0
  19. package/dist/SchemaWatch.d.ts.map +1 -0
  20. package/dist/SchemaWatch.js +34 -0
  21. package/dist/SchemaWatch.js.map +1 -0
  22. package/lib/DboBuilder.d.ts.map +1 -1
  23. package/lib/DboBuilder.js +9 -17
  24. package/lib/DboBuilder.ts +9 -16
  25. package/lib/Filtering.d.ts.map +1 -1
  26. package/lib/Filtering.js +11 -2
  27. package/lib/Filtering.ts +18 -3
  28. package/lib/PostgresNotifListenManager.d.ts +1 -1
  29. package/lib/PostgresNotifListenManager.d.ts.map +1 -1
  30. package/lib/PostgresNotifListenManager.ts +10 -3
  31. package/lib/Prostgles.d.ts +2 -0
  32. package/lib/Prostgles.d.ts.map +1 -1
  33. package/lib/Prostgles.js +2 -5
  34. package/lib/Prostgles.ts +24 -26
  35. package/lib/PubSubManager.d.ts +5 -0
  36. package/lib/PubSubManager.d.ts.map +1 -1
  37. package/lib/PubSubManager.js +27 -16
  38. package/lib/PubSubManager.ts +28 -17
  39. package/lib/SchemaWatch.d.ts +13 -0
  40. package/lib/SchemaWatch.d.ts.map +1 -0
  41. package/lib/SchemaWatch.js +33 -0
  42. package/lib/SchemaWatch.ts +40 -0
  43. package/package.json +1 -1
  44. package/tests/client/PID.txt +1 -1
  45. package/tests/server/package-lock.json +20 -20
  46. package/tests/server/package.json +1 -1
  47. package/dist/QueryBuilder.d.ts +0 -150
  48. package/dist/QueryBuilder.d.ts.map +0 -1
  49. package/dist/QueryBuilder.js +0 -1381
  50. package/dist/QueryBuilder.js.map +0 -1
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { PostgresNotifListenManager } from "./PostgresNotifListenManager";
7
7
  import { get } from "./utils";
8
- import { TableOrViewInfo, TableInfo, DBHandlerServer, TableHandler, DboBuilder, PRGLIOSocket } from "./DboBuilder";
8
+ import { TableOrViewInfo, TableInfo, DBHandlerServer, DboBuilder, PRGLIOSocket, canEXECUTE } from "./DboBuilder";
9
9
  import { DB, isSuperUser } from "./Prostgles";
10
10
 
11
11
  import * as Bluebird from "bluebird";
@@ -143,8 +143,9 @@ export class PubSubManager {
143
143
  NOTIF_CHANNEL = {
144
144
  preffix: 'prostgles_',
145
145
  getFull: (appID?: string) => {
146
- if (!this.appID && !appID) throw "No appID";
147
- return this.NOTIF_CHANNEL.preffix + (appID || this.appID);
146
+ const finalAppId = appID ?? this.appID;
147
+ if (!finalAppId) throw "No appID";
148
+ return this.NOTIF_CHANNEL.preffix + finalAppId;
148
149
  }
149
150
  }
150
151
 
@@ -170,6 +171,12 @@ export class PubSubManager {
170
171
  // WHERE application_name IS NOT NULL AND application_name != '' -- state = 'active';
171
172
  // `))
172
173
 
174
+ public static canCreate = async (db: DB) => {
175
+
176
+ const canExecute = await canEXECUTE(db);
177
+ const isSuperUs = await isSuperUser(db);
178
+ return { canExecute, isSuperUs, yes: canExecute && isSuperUs };
179
+ }
173
180
 
174
181
  public static create = async (options: PubSubManagerOptions) => {
175
182
  const res = new PubSubManager(options);
@@ -665,29 +672,33 @@ export class PubSubManager {
665
672
 
666
673
  --RAISE NOTICE 'SCHEMA_WATCH: %', tg_tag;
667
674
 
675
+ /*
676
+ This event trigger will outlive a prostgles app instance.
677
+ Must ensure it only fires if an app instance is running
678
+ */
668
679
  IF
669
- EXISTS (
670
- SELECT 1
671
- FROM information_schema.tables
672
- WHERE table_schema = 'prostgles'
673
- AND table_name = 'apps'
674
- )
680
+ EXISTS (
681
+ SELECT 1
682
+ FROM information_schema.tables
683
+ WHERE table_schema = 'prostgles'
684
+ AND table_name = 'apps'
685
+ )
675
686
  THEN
676
687
 
677
688
  SELECT LEFT(COALESCE(current_query(), ''), 5000)
678
689
  INTO curr_query;
679
690
 
680
691
  FOR arw IN
681
- SELECT * FROM prostgles.apps WHERE watching_schema IS TRUE
692
+ SELECT * FROM prostgles.apps WHERE watching_schema IS TRUE
682
693
 
683
694
  LOOP
684
- PERFORM pg_notify(
685
- ${asValue(this.NOTIF_CHANNEL.preffix)} || arw.id,
686
- concat_ws(
687
- ${asValue(PubSubManager.DELIMITER)},
688
- ${asValue(this.NOTIF_TYPE.schema)}, tg_tag , TG_event, curr_query
689
- )
690
- );
695
+ PERFORM pg_notify(
696
+ ${asValue(this.NOTIF_CHANNEL.preffix)} || arw.id,
697
+ concat_ws(
698
+ ${asValue(PubSubManager.DELIMITER)},
699
+ ${asValue(this.NOTIF_TYPE.schema)}, tg_tag , TG_event, curr_query
700
+ )
701
+ );
691
702
  END LOOP;
692
703
 
693
704
  END IF;
@@ -0,0 +1,13 @@
1
+ /// <reference types="node" />
2
+ import { DboBuilder } from "./DboBuilder";
3
+ import { ProstglesInitOptions } from "./Prostgles";
4
+ export declare type VoidFunction = () => void;
5
+ export declare class SchemaWatch {
6
+ schema_checkIntervalMillis?: NodeJS.Timeout;
7
+ loaded: boolean;
8
+ constructor({ watchSchema, watchSchemaType, tsGeneratedTypesDir, currDbuilder, onSchemaChanged }: ProstglesInitOptions & {
9
+ currDbuilder: DboBuilder;
10
+ onSchemaChanged: VoidFunction;
11
+ });
12
+ }
13
+ //# sourceMappingURL=SchemaWatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaWatch.d.ts","sourceRoot":"","sources":["SchemaWatch.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,oBAAY,YAAY,GAAG,MAAM,IAAI,CAAC;AAEtC,qBAAa,WAAW;IACtB,0BAA0B,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC;IAC5C,MAAM,UAAS;gBAEH,EAAE,WAAW,EAAE,eAAe,EAAE,mBAAmB,EAAE,YAAY,EAAE,eAAe,EAAE,EAAE,oBAAoB,GAAG;QAAE,YAAY,EAAE,UAAU,CAAC;QAAC,eAAe,EAAE,YAAY,CAAA;KAAE;CA8BrL"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SchemaWatch = void 0;
4
+ const prostgles_types_1 = require("prostgles-types");
5
+ const DboBuilder_1 = require("./DboBuilder");
6
+ class SchemaWatch {
7
+ constructor({ watchSchema, watchSchemaType, tsGeneratedTypesDir, currDbuilder, onSchemaChanged }) {
8
+ this.loaded = false;
9
+ if (!watchSchema)
10
+ return;
11
+ if (watchSchema === "hotReloadMode" && !tsGeneratedTypesDir) {
12
+ throw "tsGeneratedTypesDir option is needed for watchSchema: hotReloadMode to work ";
13
+ }
14
+ else if ((0, prostgles_types_1.isObject)(watchSchemaType) &&
15
+ "checkIntervalMillis" in watchSchemaType &&
16
+ typeof watchSchemaType.checkIntervalMillis === "number") {
17
+ if (this.schema_checkIntervalMillis) {
18
+ clearInterval(this.schema_checkIntervalMillis);
19
+ }
20
+ this.schema_checkIntervalMillis = setInterval(async () => {
21
+ if (!this.loaded)
22
+ return;
23
+ const dbuilder = await DboBuilder_1.DboBuilder.create(this);
24
+ if (dbuilder.tsTypesDefinition !== currDbuilder.tsTypesDefinition) {
25
+ onSchemaChanged();
26
+ }
27
+ }, watchSchemaType.checkIntervalMillis);
28
+ }
29
+ else if (watchSchemaType === "DDL_trigger") {
30
+ }
31
+ }
32
+ }
33
+ exports.SchemaWatch = SchemaWatch;
@@ -0,0 +1,40 @@
1
+ import { isObject } from "prostgles-types";
2
+ import { DboBuilder } from "./DboBuilder";
3
+ import { ProstglesInitOptions } from "./Prostgles";
4
+ export type VoidFunction = () => void;
5
+
6
+ export class SchemaWatch {
7
+ schema_checkIntervalMillis?: NodeJS.Timeout;
8
+ loaded = false;
9
+
10
+ constructor({ watchSchema, watchSchemaType, tsGeneratedTypesDir, currDbuilder, onSchemaChanged }: ProstglesInitOptions & { currDbuilder: DboBuilder; onSchemaChanged: VoidFunction }){
11
+ if(!watchSchema) return;
12
+
13
+ if (watchSchema === "hotReloadMode" && !tsGeneratedTypesDir) {
14
+ throw "tsGeneratedTypesDir option is needed for watchSchema: hotReloadMode to work ";
15
+
16
+ } else if (
17
+ isObject(watchSchemaType) &&
18
+ "checkIntervalMillis" in watchSchemaType &&
19
+ typeof watchSchemaType.checkIntervalMillis === "number"
20
+ ) {
21
+
22
+ if (this.schema_checkIntervalMillis) {
23
+ clearInterval(this.schema_checkIntervalMillis);
24
+ }
25
+ this.schema_checkIntervalMillis = setInterval(async () => {
26
+ if(!this.loaded) return;
27
+ const dbuilder = await DboBuilder.create(this as any);
28
+ if (dbuilder.tsTypesDefinition !== currDbuilder.tsTypesDefinition) {
29
+ onSchemaChanged();
30
+ }
31
+ }, watchSchemaType.checkIntervalMillis);
32
+
33
+ } else if(watchSchemaType === "DDL_trigger"){
34
+
35
+ }
36
+
37
+ }
38
+
39
+
40
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prostgles-server",
3
- "version": "3.0.36",
3
+ "version": "3.0.37",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1 +1 @@
1
- 36737
1
+ 103710
@@ -12,7 +12,7 @@
12
12
  "@types/node": "^14.14.19",
13
13
  "express": "^4.17.1",
14
14
  "prostgles-server": "file:../..",
15
- "socket.io": "^4.5.3"
15
+ "socket.io": "^4.5.4"
16
16
  },
17
17
  "devDependencies": {
18
18
  "tsc-watch": "^4.5.0",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "../..": {
23
23
  "name": "prostgles-server",
24
- "version": "3.0.35",
24
+ "version": "3.0.36",
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
27
  "@aws-sdk/client-s3": "^3.121.0",
@@ -223,9 +223,9 @@
223
223
  }
224
224
  },
225
225
  "node_modules/engine.io": {
226
- "version": "6.2.0",
227
- "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.2.0.tgz",
228
- "integrity": "sha512-4KzwW3F3bk+KlzSOY57fj/Jx6LyRQ1nbcyIadehl+AnXjKT7gDO0ORdRi/84ixvMKTym6ZKuxvbzN62HDDU1Lg==",
226
+ "version": "6.2.1",
227
+ "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.2.1.tgz",
228
+ "integrity": "sha512-ECceEFcAaNRybd3lsGQKas3ZlMVjN3cyWwMP25D2i0zWfyiytVbTpRPa34qrr+FHddtpBVOmq4H/DCv1O0lZRA==",
229
229
  "dependencies": {
230
230
  "@types/cookie": "^0.4.1",
231
231
  "@types/cors": "^2.8.12",
@@ -510,7 +510,7 @@
510
510
  "node_modules/object-assign": {
511
511
  "version": "4.1.1",
512
512
  "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
513
- "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
513
+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
514
514
  "engines": {
515
515
  "node": ">=0.10.0"
516
516
  }
@@ -697,16 +697,16 @@
697
697
  }
698
698
  },
699
699
  "node_modules/socket.io": {
700
- "version": "4.5.3",
701
- "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.5.3.tgz",
702
- "integrity": "sha512-zdpnnKU+H6mOp7nYRXH4GNv1ux6HL6+lHL8g7Ds7Lj8CkdK1jJK/dlwsKDculbyOHifcJ0Pr/yeXnZQ5GeFrcg==",
700
+ "version": "4.5.4",
701
+ "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.5.4.tgz",
702
+ "integrity": "sha512-m3GC94iK9MfIEeIBfbhJs5BqFibMtkRk8ZpKwG2QwxV0m/eEhPIV4ara6XCF1LWNAus7z58RodiZlAH71U3EhQ==",
703
703
  "dependencies": {
704
704
  "accepts": "~1.3.4",
705
705
  "base64id": "~2.0.0",
706
706
  "debug": "~4.3.2",
707
- "engine.io": "~6.2.0",
707
+ "engine.io": "~6.2.1",
708
708
  "socket.io-adapter": "~2.4.0",
709
- "socket.io-parser": "~4.2.0"
709
+ "socket.io-parser": "~4.2.1"
710
710
  },
711
711
  "engines": {
712
712
  "node": ">=10.0.0"
@@ -1088,9 +1088,9 @@
1088
1088
  "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
1089
1089
  },
1090
1090
  "engine.io": {
1091
- "version": "6.2.0",
1092
- "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.2.0.tgz",
1093
- "integrity": "sha512-4KzwW3F3bk+KlzSOY57fj/Jx6LyRQ1nbcyIadehl+AnXjKT7gDO0ORdRi/84ixvMKTym6ZKuxvbzN62HDDU1Lg==",
1091
+ "version": "6.2.1",
1092
+ "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.2.1.tgz",
1093
+ "integrity": "sha512-ECceEFcAaNRybd3lsGQKas3ZlMVjN3cyWwMP25D2i0zWfyiytVbTpRPa34qrr+FHddtpBVOmq4H/DCv1O0lZRA==",
1094
1094
  "requires": {
1095
1095
  "@types/cookie": "^0.4.1",
1096
1096
  "@types/cors": "^2.8.12",
@@ -1315,7 +1315,7 @@
1315
1315
  "object-assign": {
1316
1316
  "version": "4.1.1",
1317
1317
  "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
1318
- "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
1318
+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="
1319
1319
  },
1320
1320
  "on-finished": {
1321
1321
  "version": "2.3.0",
@@ -1477,16 +1477,16 @@
1477
1477
  "dev": true
1478
1478
  },
1479
1479
  "socket.io": {
1480
- "version": "4.5.3",
1481
- "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.5.3.tgz",
1482
- "integrity": "sha512-zdpnnKU+H6mOp7nYRXH4GNv1ux6HL6+lHL8g7Ds7Lj8CkdK1jJK/dlwsKDculbyOHifcJ0Pr/yeXnZQ5GeFrcg==",
1480
+ "version": "4.5.4",
1481
+ "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.5.4.tgz",
1482
+ "integrity": "sha512-m3GC94iK9MfIEeIBfbhJs5BqFibMtkRk8ZpKwG2QwxV0m/eEhPIV4ara6XCF1LWNAus7z58RodiZlAH71U3EhQ==",
1483
1483
  "requires": {
1484
1484
  "accepts": "~1.3.4",
1485
1485
  "base64id": "~2.0.0",
1486
1486
  "debug": "~4.3.2",
1487
- "engine.io": "~6.2.0",
1487
+ "engine.io": "~6.2.1",
1488
1488
  "socket.io-adapter": "~2.4.0",
1489
- "socket.io-parser": "~4.2.0"
1489
+ "socket.io-parser": "~4.2.1"
1490
1490
  },
1491
1491
  "dependencies": {
1492
1492
  "debug": {
@@ -16,7 +16,7 @@
16
16
  "@types/node": "^14.14.19",
17
17
  "express": "^4.17.1",
18
18
  "prostgles-server": "file:../..",
19
- "socket.io": "^4.5.3"
19
+ "socket.io": "^4.5.4"
20
20
  },
21
21
  "devDependencies": {
22
22
  "tsc-watch": "^4.5.0",
@@ -1,150 +0,0 @@
1
- import { Filter, LocalParams, TableHandler } from "./DboBuilder";
2
- import { TableRule } from "./PublishParser";
3
- import { SelectParams, ColumnInfo, PG_COLUMN_UDT_DATA_TYPE, Select } from "prostgles-types";
4
- export declare type SelectItem = {
5
- type: "column" | "function" | "aggregation" | "joinedColumn" | "computed";
6
- getFields: (args?: any[]) => string[] | "*";
7
- getQuery: (tableAlias?: string) => string;
8
- columnPGDataType?: string;
9
- column_udt_type?: PG_COLUMN_UDT_DATA_TYPE;
10
- alias: string;
11
- selected: boolean;
12
- };
13
- export declare type NewQuery = {
14
- allFields: string[];
15
- /**
16
- * Contains user selection and all the allowed columns. Allowed columns not selected are marked with selected: false
17
- */
18
- select: SelectItem[];
19
- table: string;
20
- where: string;
21
- orderBy: string[];
22
- having: string;
23
- limit: number;
24
- offset: number;
25
- isLeftJoin: boolean;
26
- joins?: NewQuery[];
27
- tableAlias?: string;
28
- $path?: string[];
29
- };
30
- export declare const asNameAlias: (field: string, tableAlias?: string) => string;
31
- export declare const parseFunctionObject: (funcData: any) => {
32
- funcName: string;
33
- args: any[];
34
- };
35
- export declare const parseFunction: (funcData: {
36
- func: string | FunctionSpec;
37
- args: any[];
38
- functions: FunctionSpec[];
39
- allowedFields: string[];
40
- }) => FunctionSpec;
41
- declare type GetQueryArgs = {
42
- allColumns: ColumnInfo[];
43
- allowedFields: string[];
44
- args: any[];
45
- tableAlias?: string;
46
- ctidField?: string;
47
- };
48
- export declare type FieldSpec = {
49
- name: string;
50
- type: "column" | "computed";
51
- /**
52
- * allowedFields passed for multicol functions (e.g.: $rowhash)
53
- */
54
- getQuery: (params: Omit<GetQueryArgs, "args">) => string;
55
- };
56
- export declare type FunctionSpec = {
57
- name: string;
58
- description?: string;
59
- /**
60
- * If true then it can be used in filters and is expected to return boolean
61
- */
62
- canBeUsedForFilter?: boolean;
63
- /**
64
- * If true then the first argument is expected to be a column name
65
- */
66
- singleColArg: boolean;
67
- /**
68
- * If true then this func can be used within where clause
69
- */
70
- /**
71
- * Number of arguments expected
72
- */
73
- numArgs: number;
74
- /**
75
- * If provided then the number of column names provided to the function (from getFields()) must not be less than this
76
- * By default every function is checked against numArgs
77
- */
78
- minCols?: number;
79
- type: "function" | "aggregation" | "computed";
80
- /**
81
- * getFields: string[] -> used to validate user supplied field names. It will be fired before querying to validate against allowed columns
82
- * if not field names are used from arguments then return an empty array
83
- */
84
- getFields: (args: any[]) => "*" | string[];
85
- /**
86
- * allowedFields passed for multicol functions (e.g.: $rowhash)
87
- */
88
- getQuery: (params: GetQueryArgs) => string;
89
- returnType?: PG_COLUMN_UDT_DATA_TYPE;
90
- };
91
- /**
92
- * Each function expects a column at the very least
93
- */
94
- export declare const FUNCTIONS: FunctionSpec[];
95
- export declare const COMPUTED_FIELDS: FieldSpec[];
96
- export declare class SelectItemBuilder {
97
- select: SelectItem[];
98
- private allFields;
99
- private allowedFields;
100
- private computedFields;
101
- private functions;
102
- private allowedFieldsIncludingComputed;
103
- private isView;
104
- private columns;
105
- constructor(params: {
106
- allowedFields: string[];
107
- computedFields: FieldSpec[];
108
- functions: FunctionSpec[];
109
- allFields: string[];
110
- isView: boolean;
111
- columns: ColumnInfo[];
112
- });
113
- private checkField;
114
- private addItem;
115
- private addFunction;
116
- addColumn: (fieldName: string, selected: boolean) => void;
117
- parseUserSelect: (userSelect: Select, joinParse?: ((key: string, val: any, throwErr: (msg: string) => any) => any) | undefined) => Promise<never[] | undefined>;
118
- }
119
- export declare function getNewQuery(_this: TableHandler, filter: Filter, selectParams: ({
120
- limit?: number | undefined;
121
- offset?: number | undefined;
122
- groupBy?: boolean | undefined;
123
- returnType?: "values" | "row" | "value" | "statement" | undefined;
124
- } & {
125
- select?: import("prostgles-types").AnyObject | ("" | "*" | {
126
- "*": 1;
127
- }) | {
128
- [x: string]: Record<string, import("prostgles-types").AnyObject>;
129
- } | {
130
- [x: string]: Record<string, any[]>;
131
- } | {
132
- [key: string]: string | true | 1 | Record<string, any[]>;
133
- } | ({
134
- [x: string]: string | true | 1;
135
- } & {
136
- [x: string]: Record<string, any[]>;
137
- }) | {
138
- [x: string]: string | true | 1;
139
- } | {
140
- [x: string]: false | 0;
141
- } | {
142
- [x: string]: false | 0;
143
- } | undefined;
144
- orderBy?: import("prostgles-types").OrderBy<any> | undefined;
145
- } & {
146
- alias?: string | undefined;
147
- }) | undefined, param3_unused: null | undefined, tableRules: TableRule | undefined, localParams: LocalParams | undefined, columns: ColumnInfo[]): Promise<NewQuery>;
148
- export declare function makeQuery(_this: TableHandler, q: NewQuery, depth?: number, joinFields?: string[], selectParams?: SelectParams): string;
149
- export {};
150
- //# sourceMappingURL=QueryBuilder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QueryBuilder.d.ts","sourceRoot":"","sources":["../lib/QueryBuilder.ts"],"names":[],"mappings":"AAMA,OAAO,EAAO,MAAM,EAAE,WAAW,EAAiB,YAAY,EAAiC,MAAM,cAAc,CAAC;AACpH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAqE,UAAU,EAAE,uBAAuB,EAAY,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAIzK,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,QAAQ,GAAG,UAAU,GAAG,aAAa,GAAG,cAAc,GAAG,UAAU,CAAC;IAC1E,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,MAAM,EAAE,GAAG,GAAG,CAAC;IAC5C,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAE1C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACrB,SAAS,EAAE,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