MCPcopy Create free account
hub / github.com/subquery/subql / commentOn

Function commentOn

packages/node-core/src/db/sync-helper.ts:88–96  ·  view source on GitHub ↗
(
  type: 'CONSTRAINT' | 'TABLE' | 'COLUMN' | 'FUNCTION',
  entity: string,
  comment: string,
  constraint?: string
)

Source from the content-addressed store, hash-verified

86}
87
88function 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
98export function commentConstraintQuery(schema: string, table: string, constraint: string, comment: string): Query {
99 return commentOn('CONSTRAINT', escapedName(schema, table), comment, constraint);

Callers 4

commentConstraintQueryFunction · 0.85
commentTableQueryFunction · 0.85
commentColumnQueryFunction · 0.85
commentOnFunctionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected