Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ForeignKey ¶
type Index ¶
type Index struct {
Name string `json:"name"`
Columns []string `json:"columns"`
Unique bool `json:"unique"`
// Method is the access method (btree, gin, hash, ...). Lowercased so
// values match across Postgres and MySQL (MySQL returns BTREE in
// upper-case from information_schema.statistics).
Method string `json:"method,omitempty"`
// Where holds the partial-index predicate expression for Postgres
// indexes that have one (e.g., "(deleted_at IS NULL)"). Always empty
// for MySQL, which has no first-class partial indexes.
Where string `json:"where,omitempty"`
}
type Introspector ¶
type Introspector interface {
Introspect(ctx context.Context, db *sql.DB, allowedSchemas []string) (Schema, error)
}
func MySQLIntrospector ¶
func MySQLIntrospector() Introspector
func PostgresIntrospector ¶
func PostgresIntrospector() Introspector
type Table ¶
type Table struct {
Schema string `json:"schema"`
Name string `json:"name"`
PrimaryKey []string `json:"primary_key"`
Columns []Column `json:"columns"`
ForeignKeys []ForeignKey `json:"foreign_keys"`
ReferencedBy []ForeignKey `json:"referenced_by"`
Indexes []Index `json:"indexes"`
}
Click to show internal directories.
Click to hide internal directories.