qm

package
v0.0.0-...-98c8ee3 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(q *queries.Query, mods ...QueryMod)

Apply the query mods to the Query object

Types

type QueryMod

type QueryMod func(q *queries.Query)

QueryMod to modify the query object

func For

func For(clause string) QueryMod

For inserts a concurrency locking clause at the end of your statement

func From

func From(from string) QueryMod

From allows to specify the model for your statement

func GroupBy

func GroupBy(clause string) QueryMod

GroupBy allows you to specify a group by clause for your statement

func Having

func Having(clause string, args ...interface{}) QueryMod

Having allows you to specify a having clause for your statement

func InnerJoin

func InnerJoin(clause string, args ...interface{}) QueryMod

InnerJoin on another model

func Limit

func Limit(limit int) QueryMod

Limit the number of returned rows

func Load

func Load(relationships ...string) QueryMod

Load allows you to specify foreign key relationships to eager load for your query. Passed in relationships need to be in the format MyThing or MyThings. Relationship name plurality is important, if your relationship is singular, you need to specify the singular form and vice versa.

func Offset

func Offset(offset int) QueryMod

Offset into the results

func OrderBy

func OrderBy(clause string) QueryMod

OrderBy allows you to specify a order by clause for your statement

func SQL

func SQL(sql string, args ...interface{}) QueryMod

SQL allows you to execute a plain SQL statement

func Select

func Select(fields ...string) QueryMod

Select specific fields opposed to all fields

func Where

func Where(clause string, args ...interface{}) QueryMod

Where allows you to specify a where clause for your statement

func WhereIn

func WhereIn(clause string, args ...interface{}) QueryMod

WhereIn allows you to specify a "x IN (set)" clause for your where statement Example clauses: "field in ?", "(field1,field2) in ?"

Jump to

Keyboard shortcuts

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