UNPKG

ddl-manager

Version:

store postgres procedures and triggers in files

27 lines (22 loc) 596 B
import { AbstractAstElement } from "./AbstractAstElement"; import { Spaces } from "./Spaces"; interface SetItemRow { column: string; value: AbstractAstElement; } export class SetItem extends AbstractAstElement { readonly column!: string; readonly value!: AbstractAstElement; constructor(row: SetItemRow) { super(); Object.assign(this, row); } template(spaces: Spaces) { const valueSQL = this.value .toSQL( spaces ) .trim(); return [ spaces + `${ this.column } = ${ valueSQL }` ]; } }