package
0.1.158
Repository: https://github.com/searking/golang.git
Documentation: pkg.go.dev

# Functions

No description provided by the author
CompileQuery compiles a unbound query (using the '?' bind var) into an NamedQuery.
CompliantName returns a compliant id name that can be used for a bind or as var.
ExpandAsColumns expand columns with alias AS query := ExpandAsColumns("table.foo", "bar") // []string{"table.foo AS table_foo", "bar AS bar"}.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
JoinColumns concatenates the elements of cols to column1, column2, ..
JoinColumnsWithAs concatenates the elements of cols to column1, column2, ..
JoinTableColumns concatenates the elements of cols to column1, column2, ..
JoinTableColumnsValues concatenates the elements of values to table.value1=:value1, table.value2=:value2 ..
JoinTableColumnsWithAs concatenates the elements of cols to column1, column2, ..
JoinTableValues concatenates the elements of values to :value1, :value2, ..
NamedUnbindVars rewrites unbind vars to named vars referenced in the statement.
Pagination returns the "LIMIT %d, OFFSET %d" query := Pagination(0, 0) // "LIMIT 0, OFFSET 0".
Placeholders behaves like strings.Join([]string{"?",...,"?"}, ",").
No description provided by the author
TableColumns returns the []string{table.value1, table.value2 ...} query := Columns("table", "foo", "bar") // []string{"table.foo", "table.bar"}.
ColumnsValues returns the []string{table.value1=:value1, table.value2=:value2 ...} query := ColumnsValues("table", "foo", "bar") // []string{"table.foo=?", "table.bar=?"}.
TableValues returns the []string{:value1, :value2 ...} query := TableValues("foo", "bar") // []string{"?", "?"}.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WithCompileQueryOptionAliasWithSelect Generate Alias `SELECT t.a, b` TO `select t.a as t_a, b as b`,.
WithCompileQueryOptionArgument keep column if argument by column name is not zero take effect in WHERE|INSERT|UPDATE, ignore if multi rows nil: keep all []string: keep if exist map[string]{{value}} : keep if exist and none zero struct{} tag is `db:"{{col_name}}"`: keep if exist and none zero `SELECT t.a, b FROM t WHERE first_name= :hehe AND middle_name=? OR last_name=?` TO `select t.a as t_a, b as b from t where first_name = :first_name or last_name = :last_name`,.

# Constants

No description provided by the author

# Structs

EmptyCompileQueryOption does not alter the configuration.
NullDuration represents an interface that may be null.
NullJson represents an interface that may be null.

# Interfaces

A CompileQueryOption sets options.

# Type aliases

CompileQueryOptionFunc wraps a function that modifies compileQuery into an implementation of the CompileQueryOption interface.