Add TreeModel and HasSubtree implementation

This commit is contained in:
2022-08-20 16:21:06 -05:00
parent 3d836afa59
commit f63891ef99
22 changed files with 380 additions and 108 deletions

View File

@@ -316,6 +316,8 @@ export class PostgreSQLDialect extends SQLDialect {
const field: string = constraint.field.split('.').map(x => `"${x}"`)
.join('.')
statements.push(`${indent}${statements.length < 1 ? '' : constraint.preop + ' '}${field} ${constraint.operator} ${this.escape(constraint.operand).value}`)
} else if ( constraint instanceof QuerySafeValue ) {
statements.push(`${indent}${statements.length < 1 ? '' : 'AND '}${constraint.toString()}`)
}
}

View File

@@ -14,7 +14,7 @@ export type EscapeValue = null | undefined | string | number | boolean | Date |
export type EscapeValueObject = { [field: string]: EscapeValue }
/**
* A wrapper class whose value is save to inject directly into a query.
* A wrapper class whose value is safe to inject directly into a query.
*/
export class QuerySafeValue {
constructor(