Documentation ¶
Overview ¶
Use and distribution licensed under the Apache license version 2.
See the COPYING file in the root project directory for full text.
Index ¶
- func Query(db *sql.DB, el types.Element) (*sql.Rows, error)
- func QueryContext(ctx context.Context, db *sql.DB, el types.Element) (*sql.Rows, error)
- func T(s *schema.Schema, name string) *identifier.Table
- type DeleteQuery
- func (q *DeleteQuery) ArgCount() int
- func (q *DeleteQuery) Error() error
- func (q *DeleteQuery) IsValid() bool
- func (q *DeleteQuery) Scan(s types.Scanner, b *strings.Builder, qargs []interface{}, idx *int)
- func (q *DeleteQuery) Size(s types.Scanner) int
- func (q *DeleteQuery) Where(e *expression.Expression) *DeleteQuery
- type InsertQuery
- type SelectQuery
- func (q *SelectQuery) ArgCount() int
- func (q *SelectQuery) As(alias string) *SelectQuery
- func (q *SelectQuery) C(name string) types.Projection
- func (q *SelectQuery) Error() error
- func (q *SelectQuery) GroupBy(cols ...types.Projection) *SelectQuery
- func (q *SelectQuery) Having(e *expression.Expression) *SelectQuery
- func (q *SelectQuery) IsValid() bool
- func (q *SelectQuery) Join(right interface{}, on *expression.Expression) *SelectQuery
- func (q *SelectQuery) Limit(limit int) *SelectQuery
- func (q *SelectQuery) LimitWithOffset(limit int, offset int) *SelectQuery
- func (q *SelectQuery) OrderBy(scols ...types.Sortable) *SelectQuery
- func (q *SelectQuery) OuterJoin(right interface{}, on *expression.Expression) *SelectQuery
- func (q *SelectQuery) Scan(s types.Scanner, b *strings.Builder, qargs []interface{}, idx *int)
- func (q *SelectQuery) Size(s types.Scanner) int
- func (q *SelectQuery) Where(e *expression.Expression) *SelectQuery
- type UpdateQuery
- func (q *UpdateQuery) ArgCount() int
- func (q *UpdateQuery) Error() error
- func (q *UpdateQuery) IsValid() bool
- func (q *UpdateQuery) Scan(s types.Scanner, b *strings.Builder, qargs []interface{}, idx *int)
- func (q *UpdateQuery) Size(s types.Scanner) int
- func (q *UpdateQuery) Where(e *expression.Expression) *UpdateQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Query ¶
Query accepts a `database/sql` `DB` handle and a `pkg/types.Element` and calls the `databases/sql.DB.Query` method on the SQL string produced by the `Element`.
func QueryContext ¶
QueryContext accepts a `databases/sql` `DB` handle and a `pkg/types.Element` and calls the `databases/sql.DB.Query` method on the SQL string produced by the `Element`.
Types ¶
type DeleteQuery ¶
type DeleteQuery struct {
// contains filtered or unexported fields
}
func Delete ¶
func Delete(t *identifier.Table) *DeleteQuery
Delete returns a DeleteQuery given a table that will produce a DELETE SQL statement
func (*DeleteQuery) ArgCount ¶
func (q *DeleteQuery) ArgCount() int
func (*DeleteQuery) Error ¶
func (q *DeleteQuery) Error() error
func (*DeleteQuery) IsValid ¶
func (q *DeleteQuery) IsValid() bool
func (*DeleteQuery) Where ¶
func (q *DeleteQuery) Where(e *expression.Expression) *DeleteQuery
type InsertQuery ¶
type InsertQuery struct {
// contains filtered or unexported fields
}
func Insert ¶
func Insert(t *identifier.Table, values map[string]interface{}) *InsertQuery
Given a table and a map of column name to value for that column to insert, returns an InsertQuery that will produce an INSERT SQL statement
func (*InsertQuery) ArgCount ¶
func (q *InsertQuery) ArgCount() int
func (*InsertQuery) Error ¶
func (q *InsertQuery) Error() error
func (*InsertQuery) IsValid ¶
func (q *InsertQuery) IsValid() bool
type SelectQuery ¶
type SelectQuery struct {
// contains filtered or unexported fields
}
func Select ¶
func Select(items ...interface{}) *SelectQuery
func (*SelectQuery) ArgCount ¶
func (q *SelectQuery) ArgCount() int
func (*SelectQuery) As ¶
func (q *SelectQuery) As(alias string) *SelectQuery
Returns a pointer to a new SelectQuery that has aliased its inner selection to the supplied name
func (*SelectQuery) C ¶
func (q *SelectQuery) C(name string) types.Projection
Returns the projection of the underlying SelectStatement that matches the name provided
func (*SelectQuery) Error ¶
func (q *SelectQuery) Error() error
func (*SelectQuery) GroupBy ¶
func (q *SelectQuery) GroupBy(cols ...types.Projection) *SelectQuery
func (*SelectQuery) Having ¶
func (q *SelectQuery) Having(e *expression.Expression) *SelectQuery
func (*SelectQuery) IsValid ¶
func (q *SelectQuery) IsValid() bool
func (*SelectQuery) Join ¶
func (q *SelectQuery) Join(right interface{}, on *expression.Expression) *SelectQuery
func (*SelectQuery) Limit ¶
func (q *SelectQuery) Limit(limit int) *SelectQuery
func (*SelectQuery) LimitWithOffset ¶
func (q *SelectQuery) LimitWithOffset(limit int, offset int) *SelectQuery
func (*SelectQuery) OrderBy ¶
func (q *SelectQuery) OrderBy(scols ...types.Sortable) *SelectQuery
func (*SelectQuery) OuterJoin ¶
func (q *SelectQuery) OuterJoin(right interface{}, on *expression.Expression) *SelectQuery
func (*SelectQuery) Where ¶
func (q *SelectQuery) Where(e *expression.Expression) *SelectQuery
type UpdateQuery ¶
type UpdateQuery struct {
// contains filtered or unexported fields
}
func Update ¶
func Update(t *identifier.Table, values map[string]interface{}) *UpdateQuery
Given a table and a map of column name to value for that column to update, returns an UpdateQuery that will produce an UPDATE SQL statement
func (*UpdateQuery) ArgCount ¶
func (q *UpdateQuery) ArgCount() int
func (*UpdateQuery) Error ¶
func (q *UpdateQuery) Error() error
func (*UpdateQuery) IsValid ¶
func (q *UpdateQuery) IsValid() bool
func (*UpdateQuery) Where ¶
func (q *UpdateQuery) Where(e *expression.Expression) *UpdateQuery