mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 20:46:01 +00:00
sqlgen
This commit is contained in:
15
packages/sqltree/src/dumpSqlCondition.ts
Normal file
15
packages/sqltree/src/dumpSqlCondition.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { SqlDumper } from "@dbgate/types";
|
||||
import { Condition, BinaryCondition } from "./types";
|
||||
import { dumpSqlExpression } from "./dumpSqlExpression";
|
||||
|
||||
export function dumpSqlCondition(dmp: SqlDumper, condition: Condition) {
|
||||
switch (condition.conditionType) {
|
||||
case "binary":
|
||||
dmp.put("(");
|
||||
dumpSqlExpression(dmp, condition.left);
|
||||
dmp.put(" %s ", condition.operator);
|
||||
dumpSqlExpression(dmp, condition.right);
|
||||
dmp.put(")");
|
||||
break;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user