{"modulePath":"github.com/Volatiletech/sqlboiler","version":"v3.7.1+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package queries\n\n## Constants\n\n```go\nconst (\n\tJoinInner joinKind = iota\n\tJoinOuterLeft\n\tJoinOuterRight\n\tJoinNatural\n\tJoinOuterFull\n)\n```\nJoin type constants\n\n## Functions\n\n```go\nfunc AppendFrom(q *Query, from ...string)\n```\nAppendFrom on the query.\n\n```go\nfunc AppendFullOuterJoin(q *Query, clause string, args ...interface{})\n```\nAppendFullOuterJoin on the query.\n\n```go\nfunc AppendGroupBy(q *Query, clause string)\n```\nAppendGroupBy on the query.\n\n```go\nfunc AppendHaving(q *Query, clause string, args ...interface{})\n```\nAppendHaving on the query.\n\n```go\nfunc AppendIn(q *Query, clause string, args ...interface{})\n```\nAppendIn on the query.\n\n```go\nfunc AppendInnerJoin(q *Query, clause string, args ...interface{})\n```\nAppendInnerJoin on the query.\n\n```go\nfunc AppendLeftOuterJoin(q *Query, clause string, args ...interface{})\n```\nAppendLeftOuterJoin on the query.\n\n```go\nfunc AppendLoad(q *Query, relationships string)\n```\nAppendLoad on the query.\n\n```go\nfunc AppendOrderBy(q *Query, clause string, args ...interface{})\n```\nAppendOrderBy on the query.\n\n```go\nfunc AppendRightOuterJoin(q *Query, clause string, args ...interface{})\n```\nAppendRightOuterJoin on the query.\n\n```go\nfunc AppendSelect(q *Query, columns ...string)\n```\nAppendSelect on the query.\n\n```go\nfunc AppendWhere(q *Query, clause string, args ...interface{})\n```\nAppendWhere on the query.\n\n```go\nfunc AppendWhereLeftParen(q *Query)\n```\nAppendWhereLeftParen creates a right left in the where expression\n\n```go\nfunc AppendWhereRightParen(q *Query)\n```\nAppendWhereRightParen creates a right paren in the where expression\n\n```go\nfunc AppendWith(q *Query, clause string, args ...interface{})\n```\nAppendWith on the query.\n\n```go\nfunc Assign(dst, src interface{})\n```\nAssign assigns a value to another using reflection. Dst must be a pointer.\n\n```go\nfunc Bind(rows *sql.Rows, obj interface{}) error\n```\nBind inserts the rows into the passed in object pointer, because the caller owns the rows it is imperative to note that the caller MUST both close the rows and check for errors on the rows.\n\nIf you neglect closing the rows your application may have a memory leak if the rows are not implicitly closed by iteration alone. If you neglect checking the rows.Err silent failures may occur in your application.\n\nValid types to bind to are: \\*Struct, \\[]\\*Struct, and \\[]Struct. Keep in mind if you use \\[]Struct that Bind will be doing copy-by-value as a method of keeping heap memory usage low which means if your Struct contains reference types/pointers you will see incorrect results, do not use \\[]Struct with a Struct with reference types.\n\nBind rules:\n\n  - Struct tags control bind, in the form of: \\`boil:\"name,bind\"\\`\n  - If \"name\" is omitted the sql column names that come back are TitleCased and matched against the field name.\n  - If the \"name\" part of the struct tag is specified, the given name will be used instead of the struct field name for binding.\n  - If the \"name\" of the struct tag is \"-\", this field will not be bound to.\n  - If the \",bind\" option is specified on a struct field and that field is a struct itself, it will be recursed into to look for fields for binding.\n\nExample usage:\n\n\ttype JoinStruct struct {\n\t  // User1 can have it's struct fields bound to since it specifies\n\t  // ,bind in the struct tag, it will look specifically for\n\t  // fields that are prefixed with \"user.\" returning from the query.\n\t  // For example \"user.id\" column name will bind to User1.ID\n\t  User1      *models.User `boil:\"user,bind\"`\n\t  // User2 will follow the same rules as noted above except it will use\n\t  // \"friend.\" as the prefix it's looking for.\n\t  User2      *models.User `boil:\"friend,bind\"`\n\t  // RandomData will not be recursed into to look for fields to\n\t  // bind and will not be bound to because of the - for the name.\n\t  RandomData myStruct     `boil:\"-\"`\n\t  // Date will not be recursed into to look for fields to bind because\n\t  // it does not specify ,bind in the struct tag. But it can be bound to\n\t  // as it does not specify a - for the name.\n\t  Date       time.Time\n\t}\n\n\tmodels.Users(\n\t  qm.InnerJoin(\"users as friend on users.friend_id = friend.id\")\n\t).Bind(\u0026joinStruct)\n\nFor custom objects that want to use eager loading, please see the loadRelationships function.\n\n```go\nfunc BindMapping(typ reflect.Type, mapping map[string]uint64, cols []string) ([]uint64, error)\n```\nBindMapping creates a mapping that helps look up the pointer for the column given.\n\n```go\nfunc BuildQuery(q *Query) (string, []interface{})\n```\nBuildQuery builds a query object into the query string and it's accompanying arguments. Using this method allows query building without immediate execution.\n\n```go\nfunc Equal(a, b interface{}) bool\n```\nEqual is different to reflect.DeepEqual in that it's both less efficient less magical, and dosen't concern itself with a wide variety of types that could be present but it does use the driver.Valuer interface since many types that will go through database things will use these.\n\nWe're focused on basic types + \\[]byte. Since we're really only interested in things that are typically used for primary keys in a database.\n\nChoosing not to use the DefaultParameterConverter here because sqlboiler doesn't generate pointer columns.\n\n```go\nfunc GetSelect(q *Query) []string\n```\nGetSelect from the query\n\n```go\nfunc IsNil(val interface{}) bool\n```\nIsNil is a more generic version of IsValuerNil, will check to make sure it's not a valuer first.\n\n```go\nfunc IsValuerNil(val driver.Valuer) bool\n```\nIsValuerNil returns true if the valuer's value is null.\n\n```go\nfunc MakeStructMapping(typ reflect.Type) map[string]uint64\n```\nMakeStructMapping creates a map of the struct to be able to quickly look up its pointers and values by name.\n\n```go\nfunc MustTime(val driver.Valuer) time.Time\n```\nMustTime retrieves a time value from a valuer.\n\n```go\nfunc NonZeroDefaultSet(defaults []string, obj interface{}) []string\n```\nNonZeroDefaultSet returns the fields included in the defaults slice that are non zero values\n\n```go\nfunc PtrsFromMapping(val reflect.Value, mapping []uint64) []interface{}\n```\nPtrsFromMapping expects to be passed an addressable struct and a mapping of where to find things. It pulls the pointers out referred to by the mapping.\n\n```go\nfunc SetArgs(q *Query, args ...interface{})\n```\nSetArgs is primarily for re-use of a query so that the query text does not need to be re-generated, useful if you're performing the same query with different arguments over and over.\n\n```go\nfunc SetCount(q *Query)\n```\nSetCount on the query.\n\n```go\nfunc SetDelete(q *Query)\n```\nSetDelete on the query.\n\n```go\nfunc SetDialect(q *Query, dialect *drivers.Dialect)\n```\nSetDialect on the query.\n\n```go\nfunc SetDistinct(q *Query, distinct string)\n```\nSetDistinct on the query.\n\n```go\nfunc SetFor(q *Query, clause string)\n```\nSetFor on the query.\n\n```go\nfunc SetFrom(q *Query, from ...string)\n```\nSetFrom replaces the current from statements.\n\n```go\nfunc SetLastInAsOr(q *Query)\n```\nSetLastInAsOr is an alias for SetLastWhereAsOr\n\n```go\nfunc SetLastWhereAsOr(q *Query)\n```\nSetLastWhereAsOr sets the or separator for the tail \"WHERE\" in the slice\n\n```go\nfunc SetLimit(q *Query, limit int)\n```\nSetLimit on the query.\n\n```go\nfunc SetLoad(q *Query, relationships ...string)\n```\nSetLoad on the query.\n\n```go\nfunc SetLoadMods(q *Query, rel string, appl Applicator)\n```\nSetLoadMods on the query.\n\n```go\nfunc SetOffset(q *Query, offset int)\n```\nSetOffset on the query.\n\n```go\nfunc SetSQL(q *Query, sql string, args ...interface{})\n```\nSetSQL on the query.\n\n```go\nfunc SetScanner(scanner sql.Scanner, val driver.Value)\n```\nSetScanner attempts to set a scannable value on a scanner.\n\n```go\nfunc SetSelect(q *Query, sel []string)\n```\nSetSelect on the query.\n\n```go\nfunc SetUpdate(q *Query, cols map[string]interface{})\n```\nSetUpdate on the query.\n\n```go\nfunc ValuesFromMapping(val reflect.Value, mapping []uint64) []interface{}\n```\nValuesFromMapping expects to be passed an addressable struct and a mapping of where to find things. It pulls the pointers out referred to by the mapping.\n\n## Types\n\n```go\ntype Applicator interface {\n\tApply(*Query)\n}\n```\nApplicator exists only to allow query mods into the query struct around eager loaded relationships.\n\n```go\ntype Query struct {\n\t// contains filtered or unexported fields\n}\n```\nQuery holds the state for the built up query\n\n```go\nfunc Raw(query string, args ...interface{}) *Query\n```\nRaw makes a raw query, usually for use with bind\n\n```go\nfunc RawG(query string, args ...interface{}) *Query\n```\nRawG makes a raw query using the global boil.Executor, usually for use with bind\n\n```go\nfunc (q *Query) Bind(ctx context.Context, exec boil.Executor, obj interface{}) error\n```\nBind executes the query and inserts the result into the passed in object pointer.\n\nIf Context is non-nil it will upgrade the Executor to a ContextExecutor and query with the passed context. If Context is non-nil, any eager loading that's done must also be using load\\* methods that support context as the first parameter.\n\nAlso see documentation for Bind()\n\n```go\nfunc (q *Query) BindG(ctx context.Context, obj interface{}) error\n```\nBindG executes the query and inserts the result into the passed in object pointer. It uses the global executor. Also see documentation for Bind() and Query.Bind()\n\n```go\nfunc (q *Query) BindP(ctx context.Context, exec boil.Executor, obj interface{})\n```\nBindP executes the query and inserts the result into the passed in object pointer. It panics on error. Also see documentation for Bind() and Query.Bind()\n\n```go\nfunc (q *Query) Exec(exec boil.Executor) (sql.Result, error)\n```\nExec executes a query that does not need a row returned\n\n```go\nfunc (q *Query) ExecContext(ctx context.Context, exec boil.ContextExecutor) (sql.Result, error)\n```\nExecContext executes a query that does not need a row returned\n\n```go\nfunc (q *Query) ExecP(exec boil.Executor) sql.Result\n```\nExecP executes a query that does not need a row returned It will panic on error\n\n```go\nfunc (q *Query) Query(exec boil.Executor) (*sql.Rows, error)\n```\nQuery executes the query for the All finisher and returns multiple rows\n\n```go\nfunc (q *Query) QueryContext(ctx context.Context, exec boil.ContextExecutor) (*sql.Rows, error)\n```\nQueryContext executes the query for the All finisher and returns multiple rows\n\n```go\nfunc (q *Query) QueryP(exec boil.Executor) *sql.Rows\n```\nQueryP executes the query for the All finisher and returns multiple rows It will panic on error\n\n```go\nfunc (q *Query) QueryRow(exec boil.Executor) *sql.Row\n```\nQueryRow executes the query for the One finisher and returns a row\n\n```go\nfunc (q *Query) QueryRowContext(ctx context.Context, exec boil.ContextExecutor) *sql.Row\n```\nQueryRowContext executes the query for the One finisher and returns a row\n\n","path":"github.com/Volatiletech/sqlboiler/queries","name":"queries","synopsis":"","isRedistributable":true}
