Documentation ¶
Index ¶
- func IfNotExists(o *QueryOption)
- func PublicTables(o *tableOptions)
- func PublicViews(o *viewOptions)
- func ScanMap(rows *sql.Rows, m map[string]interface{}) error
- func SelectInt(db Dbi, q string, vars ...interface{}) (int, error)
- func SelectInts(db Dbi, q string, args ...interface{}) ([]int, error)
- func SelectString(db Dbi, q string) (string, error)
- func SelectStrings(db Dbi, q string, args ...interface{}) ([]string, error)
- func SelectStruct(db Dbi, i interface{}, q string, params ...interface{}) error
- func SelectStructs(db Dbi, q string, i interface{}, params ...interface{}) error
- func UnmarshalRow(rows Rows, i interface{}) error
- func UnmarshalRows(rows Rows, i interface{}) error
- func WithName(s string) tableOpt
- type Column
- type ColumnValue
- type ColumnValues
- type Dbi
- type JsonType
- type Map
- type Migration
- type Migrator
- type QueryOption
- type Rows
- type Table
- type Valuer
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IfNotExists ¶
func IfNotExists(o *QueryOption)
func PublicTables ¶
func PublicTables(o *tableOptions)
func PublicViews ¶
func PublicViews(o *viewOptions)
func SelectStruct ¶
func SelectStructs ¶
func UnmarshalRow ¶
func UnmarshalRows ¶
Types ¶
type Column ¶
type Column struct { TableCatalog string `sql:"table_catalog"` // information_schema.sql_identifier TableSchema string `sql:"table_schema"` // information_schema.sql_identifier TableName string `sql:"table_name"` // information_schema.sql_identifier ColumnName string `sql:"column_name"` // information_schema.sql_identifier OrdinalPosition int `sql:"ordinal_position"` // information_schema.cardinal_number ColumnDefault string `sql:"column_default"` // information_schema.character_data IsNullable bool `sql:"is_nullable"` // information_schema.yes_or_no DataType string `sql:"data_type"` // information_schema.character_data CharacterMaximumLength int `sql:"character_maximum_length"` // information_schema.cardinal_number CharacterOctetLength int `sql:"character_octet_length"` // information_schema.cardinal_number NumericPrecision int `sql:"numeric_precision"` // information_schema.cardinal_number NumericPrecisionRadix int `sql:"numeric_precision_radix"` // information_schema.cardinal_number NumericScale int `sql:"numeric_scale"` // information_schema.cardinal_number DatetimePrecision int `sql:"datetime_precision"` // information_schema.cardinal_number IntervalType string `sql:"interval_type"` // information_schema.character_data IntervalPrecision int `sql:"interval_precision"` // information_schema.cardinal_number CharacterSetCatalog string `sql:"character_set_catalog"` // information_schema.sql_identifier CharacterSetSchema string `sql:"character_set_schema"` // information_schema.sql_identifier CharacterSetName string `sql:"character_set_name"` // information_schema.sql_identifier CollationCatalog string `sql:"collation_catalog"` // information_schema.sql_identifier CollationSchema string `sql:"collation_schema"` // information_schema.sql_identifier CollationName string `sql:"collation_name"` // information_schema.sql_identifier DomainCatalog string `sql:"domain_catalog"` // information_schema.sql_identifier DomainSchema string `sql:"domain_schema"` // information_schema.sql_identifier DomainName string `sql:"domain_name"` // information_schema.sql_identifier UdtCatalog string `sql:"udt_catalog"` // information_schema.sql_identifier UdtSchema string `sql:"udt_schema"` // information_schema.sql_identifier UdtName string `sql:"udt_name"` // information_schema.sql_identifier ScopeCatalog string `sql:"scope_catalog"` // information_schema.sql_identifier ScopeSchema string `sql:"scope_schema"` // information_schema.sql_identifier ScopeName string `sql:"scope_name"` // information_schema.sql_identifier MaximumCardinality int `sql:"maximum_cardinality"` // information_schema.cardinal_number DtdIdentifier string `sql:"dtd_identifier"` // information_schema.sql_identifier IsSelfReferencing bool `sql:"is_self_referencing"` // information_schema.yes_or_no IsIdentity bool `sql:"is_identity"` // information_schema.yes_or_no IdentityGeneration string `sql:"identity_generation"` // information_schema.character_data IdentityStart string `sql:"identity_start"` // information_schema.character_data IdentityIncrement string `sql:"identity_increment"` // information_schema.character_data IdentityMaximum string `sql:"identity_maximum"` // information_schema.character_data IdentityMinimum string `sql:"identity_minimum"` // information_schema.character_data IdentityCycle bool `sql:"identity_cycle"` // information_schema.yes_or_no IsGenerated string `sql:"is_generated"` // information_schema.character_data GenerationExpression string `sql:"generation_expression"` // information_schema.character_data IsUpdatable bool `sql:"is_updatable"` // information_schema.yes_or_no }
type ColumnValue ¶
type ColumnValue struct { Name string Value interface{} }
type ColumnValues ¶
type ColumnValues []*ColumnValue
func (ColumnValues) Len ¶
func (list ColumnValues) Len() int
func (ColumnValues) Less ¶
func (list ColumnValues) Less(a, b int) bool
func (ColumnValues) Names ¶
func (list ColumnValues) Names() []string
func (ColumnValues) Swap ¶
func (list ColumnValues) Swap(a, b int)
func (ColumnValues) Values ¶
func (list ColumnValues) Values() []interface{}
type Dbi ¶
type Dbi interface { QueryRow(query string, args ...interface{}) *sql.Row Query(query string, args ...interface{}) (*sql.Rows, error) Prepare(query string) (*sql.Stmt, error) Exec(query string, args ...interface{}) (sql.Result, error) }
Dbi behaves like a db or transaction
type Map ¶
type Map map[string]interface{}
func (Map) CreateTableStatement ¶
func (m Map) CreateTableStatement(name string, opts ...func(*QueryOption)) (string, error)
type Migrator ¶
func NewMigrator ¶
func NewMigrator(migrations ...interface{}) *Migrator
type QueryOption ¶
type QueryOption struct {
IfNotExists bool
}
type Table ¶
type Table struct { TableCatalog string `sql:"table_catalog"` TableSchema string `sql:"table_schema"` TableName string `sql:"table_name"` TableType string `sql:"table_type"` SelfReferencingColumnName *string `sql:"self_referencing_column_name"` ReferenceGeneration *string `sql:"reference_generation"` UserDefinedTypeCatalog *string `sql:"user_defined_type_catalog"` UserDefinedTypeSchema *string `sql:"user_defined_type_schema"` UserDefinedTypeName *string `sql:"user_defined_type_name"` IsInsertableInto string `sql:"is_insertable_into"` IsTyped string `sql:"is_typed"` CommitAction *string `sql:"commit_action"` }
type View ¶
type View struct { TableCatalog string `sql:"table_catalog"` // | information_schema.sql_identifier | TableSchema string `sql:"table_schema"` // | information_schema.sql_identifier | TableName string `sql:"table_name"` // | information_schema.sql_identifier | ViewDefinition string `sql:"view_definition"` // | information_schema.character_data | CheckOption string `sql:"check_option"` // | information_schema.character_data | IsUpdatable string `sql:"is_updatable"` // | information_schema.yes_or_no | IsInsertableInto string `sql:"is_insertable_into"` // | information_schema.yes_or_no | IsTriggerUpdatable string `sql:"is_trigger_updatable"` // | information_schema.yes_or_no | IsTriggerDeletable string `sql:"is_trigger_deletable"` // | information_schema.yes_or_no | IsTriggerInsertableInto string `sql:"is_trigger_insertable_into"` // | information_schema.yes_or_no | }
Click to show internal directories.
Click to hide internal directories.