liquidsql

package
v0.0.0-...-b11c152 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2020 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const Debug = true

Variables

View Source
var NoBackslashEscapes bool

Functions

func DefaultValueOf

func DefaultValueOf(val db.Value) (string, error)

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.

func TypeOf

func TypeOf(val db.Value) (string, error)

TypeOf returns the SQL type of the given db.Value.

Types

type Driver

type Driver struct {
	*sqle.Engine
	*sql.Context
}

Driver implements db.Driver

func (Driver) Average

func (d Driver) Average(v db.Value) (float64, error)

func (Driver) Count

func (d Driver) Count(v db.Value) (int, error)

func (Driver) Delete

func (d Driver) Delete(table db.Table, tables ...db.Table) error

Delete implements db.Driver.Delete

func (Driver) Insert

func (d Driver) Insert(row db.Row, rows ...db.Row) error

Insert implements db.Driver.Insert

func (d Driver) Link(link db.Linker, links ...db.Linker) db.Query

Link implements db.Driver.Link

func (Driver) Read

func (d Driver) Read(interface{}, ...interface{}) (int, error)

Link implements db.Driver.Link

func (Driver) Slice

func (d Driver) Slice(index, length int, values ...db.Value) db.Slicer

func (Driver) SortBy

func (d Driver) SortBy(column db.Column, columns ...db.Column) db.Query

SortBy implements db.Driver.SortBy

func (Driver) Truncate

func (d Driver) Truncate(table db.Table, tables ...db.Table) error

Truncate implements db.Driver.Truncate

func (Driver) Update

func (d Driver) Update(db.Update, ...db.Update) (int, error)

Update implements db.Driver.Update

func (Driver) Verify

func (d Driver) Verify(schema db.Schema) error

Verify implements db.Driver.Verify

func (Driver) Where

func (d Driver) Where(condition db.Condition, conditions ...db.Condition) db.Query

Where implements db.Driver.Where

type Error

type Error struct {
	Internal error

	Query  string
	Values []interface{}
}

func (Error) Error

func (err Error) Error() string

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

func (q *Query) Average(v db.Value) (float64, error)

Average implements db.Query.Average

func (*Query) Count

func (q *Query) Count(v db.Value) (int, error)

Count implements db.Query.Count

func (*Query) Delete

func (q *Query) Delete() (int, error)

Delete implements db.Query.Delete

func (Query) Error

func (q Query) Error(internal error) error

func (*Query) Get

func (q *Query) Get(value db.MutableValue, more ...db.MutableValue) error

Get implements db.Query.Get

func (q *Query) Link(db.Linker, ...db.Linker) db.Query

func (*Query) Read

func (q *Query) Read(value db.Connectable) error

Read implements db.Query.Read

func (*Query) Slice

func (q *Query) Slice(index, length int, values ...db.Value) db.Slicer

func (*Query) SortBy

func (q *Query) SortBy(column db.Column, columns ...db.Column) db.Query

func (*Query) String

func (q *Query) String() string

func (*Query) Update

func (q *Query) Update(update db.Update, updates ...db.Update) (int, error)

Update implements db.Driver.Update

func (*Query) Where

func (q *Query) Where(condition db.Condition, conditions ...db.Condition) db.Query

func (*Query) WriteColumn

func (q *Query) WriteColumn(col db.Column)

WriteColumn writes a Column to the Query.

func (*Query) WriteCondition

func (q *Query) WriteCondition(condition db.Condition)

WriteCondition writes a db.Condition to the Query.

func (*Query) WriteQuery

func (q *Query) WriteQuery(other *Query)

WriteQuery writes a Query to the Query.

func (*Query) WriteUpdate

func (q *Query) WriteUpdate(update db.Update)

WriteUpdate writes a db.Update to the Query.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL