mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 06:26:00 +00:00
Fixed UUID filtering in lsqp #538
This commit is contained in:
@@ -28,6 +28,12 @@ export function dumpSqlExpression(dmp: SqlDumper, expr: Expression) {
|
|||||||
dmp.put('%s', expr.sql);
|
dmp.put('%s', expr.sql);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'unaryRaw':
|
||||||
|
if (expr.beforeSql) dmp.putRaw(expr.beforeSql);
|
||||||
|
dumpSqlExpression(dmp, expr.expr);
|
||||||
|
if (expr.afterSql) dmp.putRaw(expr.afterSql);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'call':
|
case 'call':
|
||||||
dmp.put('%s(', expr.func);
|
dmp.put('%s(', expr.func);
|
||||||
if (expr.argsPrefix) dmp.put('%s ', expr.argsPrefix);
|
if (expr.argsPrefix) dmp.put('%s ', expr.argsPrefix);
|
||||||
@@ -36,7 +42,7 @@ export function dumpSqlExpression(dmp: SqlDumper, expr: Expression) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'methodCall':
|
case 'methodCall':
|
||||||
dumpSqlExpression(dmp, expr.thisObject)
|
dumpSqlExpression(dmp, expr.thisObject);
|
||||||
dmp.put('.%s(', expr.method);
|
dmp.put('.%s(', expr.method);
|
||||||
dmp.putCollection(',', expr.args, x => dumpSqlExpression(dmp, x));
|
dmp.putCollection(',', expr.args, x => dumpSqlExpression(dmp, x));
|
||||||
dmp.put(')');
|
dmp.put(')');
|
||||||
|
|||||||
@@ -168,6 +168,13 @@ export interface RawExpression {
|
|||||||
sql: string;
|
sql: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface UnaryRawExpression {
|
||||||
|
exprType: 'unaryRaw';
|
||||||
|
expr: Expression;
|
||||||
|
beforeSql?: string;
|
||||||
|
afterSql?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface CallExpression {
|
export interface CallExpression {
|
||||||
exprType: 'call';
|
exprType: 'call';
|
||||||
func: string;
|
func: string;
|
||||||
@@ -198,6 +205,7 @@ export type Expression =
|
|||||||
| ValueExpression
|
| ValueExpression
|
||||||
| PlaceholderExpression
|
| PlaceholderExpression
|
||||||
| RawExpression
|
| RawExpression
|
||||||
|
| UnaryRawExpression
|
||||||
| CallExpression
|
| CallExpression
|
||||||
| MethodCallExpression
|
| MethodCallExpression
|
||||||
| TranformExpression
|
| TranformExpression
|
||||||
|
|||||||
@@ -99,6 +99,19 @@ const dialect = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dataType?.toLowerCase() == 'uuid') {
|
||||||
|
return {
|
||||||
|
exprType: 'unaryRaw',
|
||||||
|
expr: {
|
||||||
|
exprType: 'column',
|
||||||
|
alias: alias || columnName,
|
||||||
|
source,
|
||||||
|
columnName,
|
||||||
|
},
|
||||||
|
afterSql: '::text',
|
||||||
|
};
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user