Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultValueOf(val db.Value) (string, error)
- func Open(connection db.Connection, cstring string) error
- func TypeOf(val db.Value) (string, error)
- type Driver
- func (d Driver) Average(v db.Value) (float64, error)
- func (d Driver) Count(v db.Value) (int, error)
- func (d Driver) Delete(table db.Table, tables ...db.Table) error
- func (d Driver) Insert(row db.Row, rows ...db.Row) error
- func (d Driver) Link(link db.Linker, links ...db.Linker) db.Query
- func (d Driver) Read(interface{}, ...interface{}) (int, error)
- func (d Driver) Slice(index, length int, values ...db.Value) db.Slicer
- func (d Driver) SortBy(column db.Column, columns ...db.Column) db.Query
- func (d Driver) Truncate(table db.Table, tables ...db.Table) error
- func (d Driver) Update(db.Update, ...db.Update) (int, error)
- func (d Driver) Verify(schema db.Schema) error
- func (d Driver) Where(condition db.Condition, conditions ...db.Condition) db.Query
- type Error
- type Query
- func (q *Query) Average(v db.Value) (float64, error)
- func (q *Query) Count(v db.Value) (int, error)
- func (q *Query) Delete() (int, error)
- func (q Query) Error(internal error) error
- func (q *Query) Get(value db.MutableValue, more ...db.MutableValue) error
- func (q *Query) Link(db.Linker, ...db.Linker) db.Query
- func (q *Query) Read(value db.Connectable) error
- func (q *Query) Slice(index, length int, values ...db.Value) db.Slicer
- func (q *Query) SortBy(column db.Column, columns ...db.Column) db.Query
- func (q *Query) String() string
- func (q *Query) Update(update db.Update, updates ...db.Update) (int, error)
- func (q *Query) Where(condition db.Condition, conditions ...db.Condition) db.Query
- func (q *Query) WriteColumn(col db.Column)
- func (q *Query) WriteCondition(condition db.Condition)
- func (q *Query) WriteQuery(other *Query)
- func (q *Query) WriteUpdate(update db.Update)
Constants ¶
const Debug = true
Variables ¶
var NoBackslashEscapes bool
Functions ¶
func DefaultValueOf ¶
DefaultValueOf returns the SQL default value of the given db.Value.
func Open ¶
func Open(connection db.Connection, cstring string) error
Open sets the given connection to be backed by a mysql connection with the given options.
Types ¶
type Driver ¶
Driver implements db.Driver
func (Driver) Delete ¶
Delete implements db.Driver.Delete
func (Driver) Insert ¶
Insert implements db.Driver.Insert
func (Driver) Link ¶
Link implements db.Driver.Link
func (Driver) Read ¶
Link implements db.Driver.Link
func (Driver) SortBy ¶
SortBy implements db.Driver.SortBy
func (Driver) Truncate ¶
Truncate implements db.Driver.Truncate
func (Driver) Update ¶
Update implements db.Driver.Update
func (Driver) Verify ¶
Verify implements db.Driver.Verify
type Error ¶
type Query ¶
type Query struct { Driver Driver Table db.Table strings.Builder Values []interface{} // contains filtered or unexported fields }
Query implements db.Query
func (*Query) Average ¶
Average implements db.Query.Average
func (*Query) Count ¶
Count implements db.Query.Count
func (*Query) Get ¶
func (q *Query) Get(value db.MutableValue, more ...db.MutableValue) error
Get implements db.Query.Get
func (*Query) Update ¶
Update implements db.Driver.Update
func (*Query) Where ¶
func (*Query) WriteColumn ¶
WriteColumn writes a Column to the Query.
func (*Query) WriteCondition ¶
WriteCondition writes a db.Condition to the Query.
func (*Query) WriteQuery ¶
WriteQuery writes a Query to the Query.