Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterProvider ¶
func RegisterProvider(provider string, h OpenHandler)
Types ¶
type Config ¶
type Config struct { Host string `yaml:"host" json:"host"` Port string `yaml:"port" json:"port"` Socket string `yaml:"socket" json:"socket"` UserName string `yaml:"username" json:"username"` Password string `yaml:"password" json:"password"` Database string `yaml:"database" json:"database"` TLS bool `yaml:"tls" json:"tls"` }
type DB ¶
type QueryRunner ¶
type StmtAggregate ¶
type StmtAggregate interface { StmtRunner // こいつらは2回呼ぶと上書き、もしくはpanicさせたほうがいいか GroupBy(columns ...string) StmtAggregate OrderBy(columns ...string) StmtAggregate Having(condition string) StmtAggregate LimitOffset(limit, offset int) StmtAggregate }
type StmtCondition ¶
type StmtCondition interface { StmtAggregate // Where系は検討の余地がたくさんあって悩んでいる Where(condition string, bind ...interface{}) StmtCondition WhereEq(column string, value interface{}) StmtCondition WhereIn(column string, values ...interface{}) StmtCondition WhereBetween(column string, a, b interface{}) StmtCondition WhereLike(column, pattern string) StmtCondition }
type StmtRunner ¶
type StmtRunner interface { All(ctx context.Context) (Rows, error) Single(ctx context.Context) (Row, error) FetchColumn(ctx context.Context, column string) (Rows, error) Count(ctx context.Context) (int, error) Update(ctx context.Context, v interface{}) error Delete(ctx context.Context, v interface{}) error }
type Tx ¶
type Tx interface { Commit() error Rollback() error QueryRunner }
Click to show internal directories.
Click to hide internal directories.