MCPcopy
hub / github.com/sqldef/sqldef / buildPostgresConstraintNameIdent

Function buildPostgresConstraintNameIdent

schema/normalize.go:217–220  ·  view source on GitHub ↗

buildPostgresConstraintNameIdent builds a PostgreSQL auto-generated constraint name and returns it as an Ident with quote information inferred from case.

(tableName, columnName, suffix string)

Source from the content-addressed store, hash-verified

215// buildPostgresConstraintNameIdent builds a PostgreSQL auto-generated constraint name
216// and returns it as an Ident with quote information inferred from case.
217func buildPostgresConstraintNameIdent(tableName, columnName, suffix string) Ident {
218 name := buildPostgresConstraintName(tableName, columnName, suffix)
219 return NewIdentWithQuoteDetected(name)
220}
221
222// buildMysqlForeignKeyName builds a MySQL auto-generated foreign key constraint name
223// using the format {table}_{column}_fk (similar to PostgreSQL's {table}_{column}_fkey).

Callers 3

generateAddIndexMethod · 0.85
parseTableFunction · 0.85

Calls 2

Tested by

no test coverage detected