mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 18:26:00 +00:00
19 lines
473 B
TypeScript
19 lines
473 B
TypeScript
import { SqlDumper } from "@dbgate/types";
|
|
import { Expression, ColumnRefExpression } from "./types";
|
|
import { dumpSqlSourceRef } from "./dumpSqlSource";
|
|
|
|
export function dumpSqlExpression(dmp: SqlDumper, expr: Expression) {
|
|
switch (expr.exprType) {
|
|
case "column":
|
|
{
|
|
if (expr.source) {
|
|
if (dumpSqlSourceRef(dmp, expr.source)) {
|
|
dmp.put(".");
|
|
}
|
|
}
|
|
dmp.put("%i", expr.columnName);
|
|
}
|
|
break;
|
|
}
|
|
}
|