( type: 'CONSTRAINT' | 'TABLE' | 'COLUMN' | 'FUNCTION', entity: string, comment: string, constraint?: string )
| 86 | } |
| 87 | |
| 88 | function commentOn( |
| 89 | type: 'CONSTRAINT' | 'TABLE' | 'COLUMN' | 'FUNCTION', |
| 90 | entity: string, |
| 91 | comment: string, |
| 92 | constraint?: string |
| 93 | ): Query { |
| 94 | const constraintPart = constraint ? `${constraint} ON ` : ''; |
| 95 | return {sql: `COMMENT ON ${type} ${constraintPart}${entity} IS ?;`, replacements: [comment]}; |
| 96 | } |
| 97 | |
| 98 | export function commentConstraintQuery(schema: string, table: string, constraint: string, comment: string): Query { |
| 99 | return commentOn('CONSTRAINT', escapedName(schema, table), comment, constraint); |
no outgoing calls
no test coverage detected