mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-25 23:36:01 +00:00
grid - grouping
This commit is contained in:
@@ -27,5 +27,11 @@ export function dumpSqlExpression(dmp: SqlDumper, expr: Expression) {
|
||||
case 'raw':
|
||||
dmp.put('%s', expr.sql);
|
||||
break;
|
||||
|
||||
case 'call':
|
||||
dmp.put('%s(%s', expr.func, expr.argsPrefix);
|
||||
dmp.putCollection(',', expr.args, (x) => dumpSqlExpression(dmp, x));
|
||||
dmp.put(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,14 @@ export interface RawExpression {
|
||||
sql: string;
|
||||
}
|
||||
|
||||
export type Expression = ColumnRefExpression | ValueExpression | PlaceholderExpression | RawExpression;
|
||||
export interface CallExpression {
|
||||
exprType: 'call';
|
||||
func: string;
|
||||
args: Expression[];
|
||||
argsPrefix?: string; // DISTINCT in case of COUNT DISTINCT
|
||||
}
|
||||
|
||||
export type Expression = ColumnRefExpression | ValueExpression | PlaceholderExpression | RawExpression | CallExpression;
|
||||
export type OrderByExpression = Expression & { direction: 'ASC' | 'DESC' };
|
||||
|
||||
export type ResultField = Expression & { alias?: string };
|
||||
|
||||
Reference in New Issue
Block a user