Documentation
¶
Index ¶
- type Attribute
- type Column
- type Driver
- func (d *Driver) Close() error
- func (d *Driver) Dialect() string
- func (d *Driver) Exec(ctx context.Context, query string, args ...any) (any, error)
- func (d *Driver) Query(ctx context.Context, query string, args ...any) (any, error)
- func (d *Driver) QueryRow(ctx context.Context, query string, args ...any) (any, error)
- type Expression
- type ForeignKey
- type Index
- type IndexColumn
- type Inspector
- type ReferenceOption
- type Schema
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct { Name string Type spec.Type Unique bool Nullable bool Sensitive bool Comment string Default sql.NullString Charset string Collation string Precision int Scale int Primary bool AutoIncrement bool OnUpdate bool Attrs []Attribute Table *Table }
Column represents a column definition.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
type Expression ¶
type Expression interface{}
type ForeignKey ¶
type ForeignKey struct { Name string Table *Table Columns []*Column RefTable *Table RefColumns []*Column Inverse bool OnUpdate ReferenceOption OnDelete ReferenceOption Attrs []Attribute }
type IndexColumn ¶
type IndexColumn struct { SeqNo int Column string Sub int Expr Expression }
type ReferenceOption ¶
type ReferenceOption string
ReferenceOption represents constraint actions.
const ( NoAction ReferenceOption = "NO ACTION" Restrict ReferenceOption = "RESTRICT" Cascade ReferenceOption = "CASCADE" SetNull ReferenceOption = "SET NULL" SetDefault ReferenceOption = "SET DEFAULT" )
https://dev.mysql.com/doc/refman/8.0/en/create-table-foreign-keys.html#foreign-key-referential-actions the referential action specified by ON UPDATE and ON DELETE subclauses of the FOREIGN KEY clause
Click to show internal directories.
Click to hide internal directories.