MCPcopy
hub / github.com/ent/ent / matchSchema

Method matchSchema

dialect/sql/schema/postgres.go:73–82  ·  view source on GitHub ↗

matchSchema returns the predicate for matching table schema.

(columns ...string)

Source from the content-addressed store, hash-verified

71
72// matchSchema returns the predicate for matching table schema.
73func (d *Postgres) matchSchema(columns ...string) *sql.Predicate {
74 column := "table_schema"
75 if len(columns) > 0 {
76 column = columns[0]
77 }
78 if d.schema != "" {
79 return sql.EQ(column, d.schema)
80 }
81 return sql.EQ(column, sql.Raw("CURRENT_SCHEMA()"))
82}
83
84// maxCharSize defines the maximum size of limited character types in Postgres (10 MB).
85const maxCharSize = 10 << 20

Callers 1

tableExistMethod · 0.95

Calls 2

EQFunction · 0.92
RawFunction · 0.92

Tested by

no test coverage detected