MCPcopy Create free account
hub / github.com/ent/ent / matchSchema

Method matchSchema

dialect/sql/schema/mysql.go:65–74  ·  view source on GitHub ↗

matchSchema returns the predicate for matching table schema.

(columns ...string)

Source from the content-addressed store, hash-verified

63
64// matchSchema returns the predicate for matching table schema.
65func (d *MySQL) matchSchema(columns ...string) *sql.Predicate {
66 column := "TABLE_SCHEMA"
67 if len(columns) > 0 {
68 column = columns[0]
69 }
70 if d.schema != "" {
71 return sql.EQ(column, d.schema)
72 }
73 return sql.EQ(column, sql.Raw("(SELECT DATABASE())"))
74}
75
76func (d *MySQL) atOpen(conn dialect.ExecQuerier) (migrate.Driver, error) {
77 return mysql.Open(&db{ExecQuerier: conn})

Callers 1

tableExistMethod · 0.95

Calls 2

EQFunction · 0.92
RawFunction · 0.92

Tested by

no test coverage detected