Versions in this module Expand all Collapse all v1 v1.0.0 Aug 19, 2017 Changes in this version + const AVG + const COUNT + const CROSSJOIN + const Cascade + const DATE + const DATEPART + const DELETE + const DISTINCT + const Equal + const FROM + const FULLOUTERJOIN + const GROUPBY + const GreaterThan + const GreaterThanOrEqual + const HAVING + const INNERJOIN + const INSERT + const INTO + const LEFTOUTERJOIN + const LIMIT + const LessThan + const LessThanOrEqual + const MAX + const MIN + const NoAction + const NotEqual + const OFFSET + const ORDERBY + const OmitEmpty + const OmitUpdate + const RIGHTOUTERJOIN + const Restrict + const SELECT + const SET + const STDDEV + const SUM + const SetDefault + const SetNull + const UPDATE + const VALUES + const VARIANCE + const WHERE + const WHITESPACE + var ErrNoColumns = errors.New("sol: cannot compile a statement without columns") + func IntegrationTest(t *testing.T, conn *DB, ddlCommit bool) + func NewTester(t *testing.T, d dialect.Dialect) *tester + func NoMatchingFields(fields []Field) bool + type Aliases map[string]string + func (aliases Aliases) Keys() []string + type ArrayClause struct + func (c ArrayClause) Compile(d dialect.Dialect, ps *Parameters) (string, error) + func (c ArrayClause) String() string + func (c ArrayClause) Wrap(str string) string + type BinaryClause struct + Post Clause + Pre Clause + Sep string + func (c BinaryClause) Compile(d dialect.Dialect, ps *Parameters) (string, error) + func (c BinaryClause) String() string + type Clause interface + func AllOf(clauses ...Clause) Clause + func AnyOf(clauses ...Clause) Clause + type ColumnElem struct + func Avg(col Columnar) ColumnElem + func Column(name string, datatype types.Type) ColumnElem + func Count(col Columnar) ColumnElem + func Date(col Columnar) ColumnElem + func DatePart(part string, col Columnar) ColumnElem + func Function(name string, col Columnar) ColumnElem + func InvalidColumn(name string, tabular Tabular) (column ColumnElem) + func Max(col Columnar) ColumnElem + func Min(col Columnar) ColumnElem + func StdDev(col Columnar) ColumnElem + func Sum(col Columnar) ColumnElem + func Variance(col Columnar) ColumnElem + func (col ColumnElem) AddOperator(op Operator) ColumnElem + func (col ColumnElem) Alias() string + func (col ColumnElem) As(alias string) ColumnElem + func (col ColumnElem) Asc() OrderedColumn + func (col ColumnElem) Between(a, b interface{}) Clause + func (col ColumnElem) Column() ColumnElem + func (col ColumnElem) Columns() []ColumnElem + func (col ColumnElem) Compile(d dialect.Dialect, ps *Parameters) (string, error) + func (col ColumnElem) Create(d dialect.Dialect) (string, error) + func (col ColumnElem) Desc() OrderedColumn + func (col ColumnElem) DoesNotEqual(param interface{}) BinaryClause + func (col ColumnElem) Equals(param interface{}) BinaryClause + func (col ColumnElem) FullName() string + func (col ColumnElem) GTE(param interface{}) BinaryClause + func (col ColumnElem) GreaterThan(param interface{}) BinaryClause + func (col ColumnElem) ILike(search string) BinaryClause + func (col ColumnElem) In(args interface{}) BinaryClause + func (col ColumnElem) IsInvalid() bool + func (col ColumnElem) IsNotNull() UnaryClause + func (col ColumnElem) IsNull() UnaryClause + func (col ColumnElem) IsValid() bool + func (col ColumnElem) LTE(param interface{}) BinaryClause + func (col ColumnElem) LessThan(param interface{}) BinaryClause + func (col ColumnElem) Like(search string) BinaryClause + func (col ColumnElem) Modify(tabular Tabular) error + func (col ColumnElem) Name() string + func (col ColumnElem) NotBetween(a, b interface{}) Clause + func (col ColumnElem) NotILike(search string) BinaryClause + func (col ColumnElem) NotLike(search string) BinaryClause + func (col ColumnElem) NullsFirst() OrderedColumn + func (col ColumnElem) NullsLast() OrderedColumn + func (col ColumnElem) Orderable() OrderedColumn + func (col ColumnElem) Table() *TableElem + func (col ColumnElem) Type() types.Type + type ColumnSet struct + func Columns(columns ...ColumnElem) ColumnSet + func (set ColumnSet) Add(columns ...Columnar) (ColumnSet, error) + func (set ColumnSet) All() []ColumnElem + func (set ColumnSet) Compile(d dialect.Dialect, ps *Parameters) (string, error) + func (set ColumnSet) Exists() bool + func (set ColumnSet) Filter(names ...string) (out ColumnSet) + func (set ColumnSet) FullNames() []string + func (set ColumnSet) Get(name string) ColumnElem + func (set ColumnSet) Has(name string) bool + func (set ColumnSet) IsEmpty() bool + func (set ColumnSet) MakeUnique() (UniqueColumnSet, error) + func (set ColumnSet) Names() []string + func (set ColumnSet) Reject(names ...string) (out ColumnSet) + type Columnar interface + Column func() ColumnElem + Name func() string + Table func() *TableElem + type Compiles interface + Compile func(dialect.Dialect, *Parameters) (string, error) + type ConditionalStmt struct + func (stmt *ConditionalStmt) AddConditional(where Clause) + func (stmt ConditionalStmt) Conditional() Clause + type Conn interface + Begin func() (TX, error) + Close func() error + Query func(stmt Executable, dest ...interface{}) error + String func(stmt Executable) string + type Connection interface + type CreateStmt struct + func (stmt CreateStmt) Compile(d dialect.Dialect, p *Parameters) (string, error) + func (stmt CreateStmt) IfNotExists() CreateStmt + func (stmt CreateStmt) String() string + func (stmt CreateStmt) Temporary() CreateStmt + type CreateViewStmt struct + func (stmt CreateViewStmt) Compile(d dialect.Dialect, p *Parameters) (string, error) + func (stmt CreateViewStmt) OrReplace() CreateViewStmt + func (stmt CreateViewStmt) String() string + func (stmt CreateViewStmt) Temporary() CreateViewStmt + type DB struct + func Open(driver, credentials string) (*DB, error) + func (c *DB) Begin() (TX, error) + func (c *DB) Close() error + func (c *DB) Dialect() dialect.Dialect + func (c *DB) Query(stmt Executable, dest ...interface{}) error + func (c *DB) String(stmt Executable) string + func (c DB) Must() *DB + func (c DB) PanicOnError() *DB + type DeleteStmt struct + func Delete(table *TableElem) (stmt DeleteStmt) + func (stmt DeleteStmt) Compile(d dialect.Dialect, ps *Parameters) (string, error) + func (stmt DeleteStmt) String() string + func (stmt DeleteStmt) Where(clauses ...Clause) DeleteStmt + type DropStmt struct + func (stmt DropStmt) Compile(d dialect.Dialect, p *Parameters) (string, error) + func (stmt DropStmt) IfExists() DropStmt + func (stmt DropStmt) String() string + type Executable interface + type FKElem struct + func ForeignKey(name string, fk Selectable, datatypes ...types.Type) FKElem + func (fk FKElem) Create(d dialect.Dialect) (string, error) + func (fk FKElem) ForeignName() string + func (fk FKElem) Modify(tabular Tabular) error + func (fk FKElem) OnDelete(b fkAction) FKElem + func (fk FKElem) OnUpdate(b fkAction) FKElem + func (fk FKElem) References() *TableElem + type Field struct + Name string + Options options + Type reflect.StructField + Value reflect.Value + func AlignFields(columns []string, fields []Field) []Field + func DeepFields(obj interface{}, index ...int) (fields []Field) + func NewField(val reflect.Value, typ reflect.StructField, index ...int) (field Field) + func (field Field) Exists() bool + func (field Field) IsIgnorable() bool + func (field Field) IsOmittable() bool + type FuncClause struct + Inner Clause + Name string + func (c FuncClause) Compile(d dialect.Dialect, ps *Parameters) (string, error) + func (c FuncClause) String() string + func (c FuncClause) Wrap(str string) string + type InsertStmt struct + func Insert(selections ...Selectable) (stmt InsertStmt) + func (stmt InsertStmt) Compile(d dialect.Dialect, ps *Parameters) (string, error) + func (stmt InsertStmt) String() string + func (stmt InsertStmt) Table() Tabular + func (stmt InsertStmt) Values(obj interface{}) InsertStmt + type JoinClause struct + func (j JoinClause) Compile(d dialect.Dialect, ps *Parameters) (string, error) + func (j JoinClause) String() string + type Modifier interface + Modify func(Tabular) error + type Operator interface + Wrap func(string) string + type Orderable interface + Orderable func() OrderedColumn + type OrderedColumn struct + func (ord OrderedColumn) Asc() OrderedColumn + func (ord OrderedColumn) Compile(d dialect.Dialect, ps *Parameters) (string, error) + func (ord OrderedColumn) Desc() OrderedColumn + func (ord OrderedColumn) NullsFirst() OrderedColumn + func (ord OrderedColumn) NullsLast() OrderedColumn + func (ord OrderedColumn) Orderable() OrderedColumn + func (ord OrderedColumn) String() string + type PKArray []string + func PrimaryKey(names ...string) PKArray + func (pk PKArray) Create(d dialect.Dialect) (string, error) + func (pk PKArray) Has(name string) bool + func (pk PKArray) Modify(tabular Tabular) error + type Parameter struct + Value interface{} + func NewParam(value interface{}) *Parameter + func (p *Parameter) Compile(d dialect.Dialect, ps *Parameters) (string, error) + type Parameters []interface + func (ps *Parameters) Add(param interface{}) + func (ps *Parameters) Len() int + func Params() *Parameters + type Result struct + func (r Result) All(obj interface{}) error + func (r Result) One(obj interface{}) error + type Scanner interface + Close func() error + Columns func() ([]string, error) + Err func() error + Next func() bool + Scan func(...interface{}) error + type SelectStmt struct + func Select(selections ...Selectable) (stmt SelectStmt) + func SelectTable(table Tabular, selects ...Selectable) (stmt SelectStmt) + func (stmt SelectStmt) All() SelectStmt + func (stmt SelectStmt) As(alias string) SelectStmt + func (stmt SelectStmt) Columns() []ColumnElem + func (stmt SelectStmt) Compile(d dialect.Dialect, ps *Parameters) (string, error) + func (stmt SelectStmt) CrossJoin(table Tabular) SelectStmt + func (stmt SelectStmt) Distinct(columns ...Columnar) SelectStmt + func (stmt SelectStmt) From(tables ...Tabular) SelectStmt + func (stmt SelectStmt) FullOuterJoin(table Tabular, clauses ...Clause) SelectStmt + func (stmt SelectStmt) GroupBy(columns ...Columnar) SelectStmt + func (stmt SelectStmt) Having(conditions ...Clause) SelectStmt + func (stmt SelectStmt) InnerJoin(table Tabular, clauses ...Clause) SelectStmt + func (stmt SelectStmt) LeftOuterJoin(table Tabular, clauses ...Clause) SelectStmt + func (stmt SelectStmt) Limit(limit int) SelectStmt + func (stmt SelectStmt) Name() string + func (stmt SelectStmt) Offset(offset int) SelectStmt + func (stmt SelectStmt) OrderBy(ords ...Orderable) SelectStmt + func (stmt SelectStmt) RightOuterJoin(table Tabular, clauses ...Clause) SelectStmt + func (stmt SelectStmt) String() string + func (stmt SelectStmt) Table() *TableElem + func (stmt SelectStmt) Where(conditions ...Clause) SelectStmt + type Selectable interface + Columns func() []ColumnElem + type SelfFKElem struct + func SelfForeignKey(name, ref string, datatypes ...types.Type) SelfFKElem + func (fk SelfFKElem) Modify(tabular Tabular) error + type Stmt struct + func (stmt *Stmt) AddMeta(msg string, args ...interface{}) + func (stmt Stmt) Error() error + type String string + func (str String) Compile(d dialect.Dialect, ps *Parameters) (string, error) + type TX interface + Commit func() error + IsSuccessful func() + Rollback func() error + type TableElem struct + func Table(name string, modifiers ...Modifier) *TableElem + func (table *TableElem) Create() CreateStmt + func (table *TableElem) Delete() DeleteStmt + func (table *TableElem) Drop() DropStmt + func (table *TableElem) ForeignKeys() []FKElem + func (table *TableElem) Has(name string) bool + func (table *TableElem) Insert() InsertStmt + func (table *TableElem) Name() string + func (table *TableElem) ReferencedBy() []FKElem + func (table *TableElem) Select(selections ...Selectable) (stmt SelectStmt) + func (table *TableElem) Table() *TableElem + func (table *TableElem) Update() UpdateStmt + func (table TableElem) C(name string) ColumnElem + func (table TableElem) Column(name string) ColumnElem + func (table TableElem) Columns() []ColumnElem + func (table TableElem) Compile(d dialect.Dialect, ps *Parameters) (string, error) + func (table TableElem) PrimaryKey() PKArray + type Tabular interface + Name func() string + Table func() *TableElem + type TextStmt struct + func Text(text string, values ...Values) TextStmt + func (stmt TextStmt) Compile(d dialect.Dialect, ps *Parameters) (string, error) + func (stmt TextStmt) String() string + func (stmt TextStmt) Values(obj interface{}) TextStmt + type Transaction interface + type UnaryClause struct + Pre Clause + Sep string + func (c UnaryClause) Compile(d dialect.Dialect, ps *Parameters) (string, error) + func (c UnaryClause) String() string + type UniqueArray []string + func Unique(names ...string) UniqueArray + func (unique UniqueArray) Create(d dialect.Dialect) (string, error) + func (unique UniqueArray) Has(name string) bool + func (unique UniqueArray) Modify(tabular Tabular) error + type UniqueColumnSet struct + func UniqueColumns() (set UniqueColumnSet) + func (set UniqueColumnSet) Add(columns ...Columnar) (UniqueColumnSet, error) + func (set UniqueColumnSet) EmptyValues() Values + func (set UniqueColumnSet) Filter(names ...string) (out UniqueColumnSet) + func (set UniqueColumnSet) Reject(names ...string) (out UniqueColumnSet) + type UpdateStmt struct + func Update(table *TableElem) (stmt UpdateStmt) + func (stmt UpdateStmt) Compile(d dialect.Dialect, ps *Parameters) (string, error) + func (stmt UpdateStmt) String() string + func (stmt UpdateStmt) Values(values Values) UpdateStmt + func (stmt UpdateStmt) Where(clauses ...Clause) UpdateStmt + type Values map[string]interface + func (v Values) Compile(d dialect.Dialect, ps *Parameters) (string, error) + func (v Values) Diff(other Values) Values + func (v Values) Equals(other Values) bool + func (v Values) Exclude(keys ...string) Values + func (v Values) Filter(keys ...string) Values + func (v Values) Keys() []string + func (v Values) MarshalJSON() ([]byte, error) + func (v Values) Merge(others ...Values) Values + func (v Values) Reject(keys ...string) Values + func (v Values) Values() []interface{} + func ValuesOf(obj interface{}) (Values, error) + type ViewElem struct + func View(name string, stmt SelectStmt) (ViewElem, error) + func (view ViewElem) Create() (stmt CreateViewStmt)