dbgate-sqltree 5.3.1 → 5.3.3

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.
@@ -23,6 +23,13 @@ function dumpSqlExpression(dmp, expr) {
23
23
  case 'raw':
24
24
  dmp.put('%s', expr.sql);
25
25
  break;
26
+ case 'unaryRaw':
27
+ if (expr.beforeSql)
28
+ dmp.putRaw(expr.beforeSql);
29
+ dumpSqlExpression(dmp, expr.expr);
30
+ if (expr.afterSql)
31
+ dmp.putRaw(expr.afterSql);
32
+ break;
26
33
  case 'call':
27
34
  dmp.put('%s(', expr.func);
28
35
  if (expr.argsPrefix)
package/lib/types.d.ts CHANGED
@@ -121,6 +121,12 @@ export interface RawExpression {
121
121
  exprType: 'raw';
122
122
  sql: string;
123
123
  }
124
+ export interface UnaryRawExpression {
125
+ exprType: 'unaryRaw';
126
+ expr: Expression;
127
+ beforeSql?: string;
128
+ afterSql?: string;
129
+ }
124
130
  export interface CallExpression {
125
131
  exprType: 'call';
126
132
  func: string;
@@ -142,7 +148,7 @@ export interface RowNumberExpression {
142
148
  exprType: 'rowNumber';
143
149
  orderBy: OrderByExpression[];
144
150
  }
145
- export type Expression = ColumnRefExpression | ValueExpression | PlaceholderExpression | RawExpression | CallExpression | MethodCallExpression | TranformExpression | RowNumberExpression;
151
+ export type Expression = ColumnRefExpression | ValueExpression | PlaceholderExpression | RawExpression | UnaryRawExpression | CallExpression | MethodCallExpression | TranformExpression | RowNumberExpression;
146
152
  export type OrderByExpression = Expression & {
147
153
  direction: 'ASC' | 'DESC';
148
154
  };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.3.1",
2
+ "version": "5.3.3",
3
3
  "name": "dbgate-sqltree",
4
4
  "main": "lib/index.js",
5
5
  "typings": "lib/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  "url": "https://github.com/dbgate/dbgate.git"
10
10
  },
11
11
  "author": "Jan Prochazka",
12
- "license": "MIT",
12
+ "license": "GPL-3.0",
13
13
  "keywords": [
14
14
  "sql",
15
15
  "mssql",
@@ -27,7 +27,7 @@
27
27
  ],
28
28
  "devDependencies": {
29
29
  "@types/node": "^13.7.0",
30
- "dbgate-types": "^5.3.1",
30
+ "dbgate-types": "^5.3.3",
31
31
  "typescript": "^4.4.3"
32
32
  },
33
33
  "dependencies": {