Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dialect ¶
type Dialect interface {
Close(context.Context) error
ReferenceKeys(context.Context, string) (ReferenceKeys, error)
ForeignKeys(context.Context, string) (ForeignKeys, error)
PrimaryKeyConstraint(context.Context, string) (string, error)
Tables(context.Context) (Tables, error)
Table(context.Context, string) (Table, error)
Columns(context.Context, string) ([]Column, error)
BulkInsert(context.Context, Table, []map[string]interface{}) error
ResultSet(context.Context, string, ...interface{}) ([]map[string]interface{}, error)
}
Dialect is the main interface to interact with RDMS.
type ForeignKey ¶
type ForeignKey struct {
Name string
Definition string
ColumnName string
ReferencedTableName string
ReferencedTable Table
ReferencedColumnName string
}
ForeignKey contains the definition of a foreign key column.
func (ForeignKey) String ¶
func (f ForeignKey) String() string
String returns the string representation of a ForeignKey.
type PrimaryKey ¶
PrimaryKey contains the defintiion of a primary key column.
func (PrimaryKey) String ¶
func (f PrimaryKey) String() string
String returns the string representation of a Primarykey.
type ReferenceKey ¶
ReferenceKey contains the definition of a reference key.
func (ReferenceKey) String ¶
func (f ReferenceKey) String() string
String returns the string representation of a ReferenceKey.
type ReferenceKeys ¶
type ReferenceKeys []ReferenceKey
ReferenceKeys contains a set of ReferenceKey.
type Table ¶
type Table struct {
Name string
PrimaryKeys []PrimaryKey
Columns Columns
ForeignKeys ForeignKeys
ReferenceKeys ReferenceKeys
}
Table contains the definition of a database table.
func (Table) PrimaryKeyColumnName ¶
PrimaryKeyColumnName returns the primary key column name.
Click to show internal directories.
Click to hide internal directories.