Documentation
¶
Index ¶
- Variables
- func AliasOf(from any) string
- func EncodeJSON(value any) any
- func RemoveLeadingBoolean(value string) string
- func TableAlias(from any) string
- func UnrecognisedDriverWarning(driver string) error
- type BaseGrammar
- func (g *BaseGrammar) AppendUpdateValueBinding(out []any, value any) []any
- func (g *BaseGrammar) Attach(self Grammar)
- func (g *BaseGrammar) Columnize(columns []any) string
- func (g *BaseGrammar) CompileAggregate(b core.Query, aggregate core.Aggregate) string
- func (g *BaseGrammar) CompileColumns(b core.Query, columns []any) string
- func (g *BaseGrammar) CompileComponents(b core.Query) []string
- func (g *BaseGrammar) CompileDelete(b core.Query) string
- func (g *BaseGrammar) CompileDeleteWithJoins(b core.Query, table string, where string) string
- func (g *BaseGrammar) CompileDeleteWithoutJoins(b core.Query, table string, where string) string
- func (g *BaseGrammar) CompileExists(b core.Query) string
- func (g *BaseGrammar) CompileFrom(b core.Query, table any) string
- func (g *BaseGrammar) CompileGroupLimit(b core.Query) string
- func (g *BaseGrammar) CompileGroups(b core.Query, groups []any) string
- func (g *BaseGrammar) CompileHaving(b core.Query, having core.Having) string
- func (g *BaseGrammar) CompileHavings(b core.Query) string
- func (g *BaseGrammar) CompileIndexHint(b core.Query, hint *core.IndexHint) string
- func (g *BaseGrammar) CompileInsert(b core.Query, values []map[string]any) string
- func (g *BaseGrammar) CompileInsertGetId(b core.Query, values []map[string]any, sequence string) string
- func (g *BaseGrammar) CompileInsertOrIgnore(b core.Query, values []map[string]any) string
- func (g *BaseGrammar) CompileInsertOrIgnoreUsing(b core.Query, columns []any, sql string) string
- func (g *BaseGrammar) CompileInsertUsing(b core.Query, columns []any, sql string) string
- func (g *BaseGrammar) CompileInsertWithOutput(b core.Query, values []map[string]any, output string) string
- func (g *BaseGrammar) CompileJoinLateral(join core.Join, expression string) string
- func (g *BaseGrammar) CompileJoins(b core.Query, joins []core.Join) string
- func (g *BaseGrammar) CompileJsonContains(column string, value string) string
- func (g *BaseGrammar) CompileJsonContainsKey(column string) string
- func (g *BaseGrammar) CompileJsonLength(column string, operator string, value string) string
- func (g *BaseGrammar) CompileJsonOverlaps(column string, value string) string
- func (g *BaseGrammar) CompileJsonUpdateColumn(key string, value any) string
- func (g *BaseGrammar) CompileJsonValueCast(value string) string
- func (g *BaseGrammar) CompileLegacyGroupLimit(b core.Query) string
- func (g *BaseGrammar) CompileLimit(b core.Query, limit *int) string
- func (g *BaseGrammar) CompileLock(b core.Query, value any) string
- func (g *BaseGrammar) CompileOffset(b core.Query, offset *int) string
- func (g *BaseGrammar) CompileOrders(b core.Query, orders []core.Order) string
- func (g *BaseGrammar) CompileRandom(seed any) string
- func (g *BaseGrammar) CompileRowNumber(partition string, orders string) string
- func (g *BaseGrammar) CompileSelect(b core.Query) string
- func (g *BaseGrammar) CompileTruncate(b core.Query) []core.Statement
- func (g *BaseGrammar) CompileUnionAggregate(b core.Query) string
- func (g *BaseGrammar) CompileUnions(b core.Query) string
- func (g *BaseGrammar) CompileUpdate(b core.Query, values core.UpdateValues) string
- func (g *BaseGrammar) CompileUpdateColumns(b core.Query, values core.UpdateValues) string
- func (g *BaseGrammar) CompileUpdateWithJoins(b core.Query, table string, columns string, where string) string
- func (g *BaseGrammar) CompileUpdateWithoutJoins(b core.Query, table string, columns string, where string) string
- func (g *BaseGrammar) CompileUpsert(b core.Query, values []map[string]any, uniqueBy []string, ...) string
- func (g *BaseGrammar) CompileWhere(b core.Query, where core.Where) string
- func (g *BaseGrammar) CompileWheres(b core.Query) string
- func (g *BaseGrammar) GetBitwiseOperators() []string
- func (g *BaseGrammar) GetDateFormat() string
- func (g *BaseGrammar) GetOperators() []string
- func (g *BaseGrammar) GetValue(expression core.Expression) string
- func (g *BaseGrammar) IsJsonSelector(value string) bool
- func (g *BaseGrammar) JsonFieldAndPath(value string) (string, string)
- func (g *BaseGrammar) Parameter(value any) string
- func (g *BaseGrammar) Parameterize(values []any) string
- func (g *BaseGrammar) Prefix() string
- func (g *BaseGrammar) PrepareBindingForJsonContains(value any) any
- func (g *BaseGrammar) PrepareBindingsForDelete(bindings map[string][]any) []any
- func (g *BaseGrammar) PrepareBindingsForUpdate(bindings map[string][]any, values core.UpdateValues) []any
- func (g *BaseGrammar) PrepareWhereLikeBinding(value string, caseSensitive bool) string
- func (g *BaseGrammar) SelectComponents() []string
- func (g *BaseGrammar) SetEscaper(escape func(any, bool) string)
- func (g *BaseGrammar) SetValueWrapper(wrapper func(string) string)
- func (g *BaseGrammar) SubstituteBindingsIntoRawSQL(sql string, bindings []any) string
- func (g *BaseGrammar) UseLegacyGroupLimit(b core.Query) bool
- func (g *BaseGrammar) WhereBasic(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereBetween(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereBetweenColumns(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereBitwise(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereColumn(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereDate(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereDay(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereExists(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereExpression(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereFullText(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereIn(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereInRaw(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereJsonBoolean(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereJsonContains(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereJsonContainsKey(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereJsonLength(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereJsonOverlaps(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereLike(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereMonth(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereNested(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereNotExists(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereNotIn(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereNotInRaw(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereNotNull(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereNull(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereRaw(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereRowValues(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereSub(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereTime(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereValueBetween(b core.Query, where core.Where) string
- func (g *BaseGrammar) WhereYear(b core.Query, where core.Where) string
- func (g *BaseGrammar) Wrap(value any) string
- func (g *BaseGrammar) WrapJsonBooleanSelector(value string) string
- func (g *BaseGrammar) WrapJsonBooleanValue(value string) string
- func (g *BaseGrammar) WrapJsonSelector(value string) string
- func (g *BaseGrammar) WrapTable(table any) string
- func (g *BaseGrammar) WrapUnion(sql string) string
- func (g *BaseGrammar) WrapValue(value string) string
- type Grammar
Constants ¶
This section is empty.
Variables ¶
var SelectComponents = []string{
"aggregate", "columns", "from", "indexHint", "joins", "wheres",
"groups", "havings", "orders", "limit", "offset", "lock",
}
SelectComponents is Laravel's $selectComponents order. The grammar compiles in this order.
Functions ¶
func EncodeJSON ¶
EncodeJSON renders a value as JSON, mirroring PHP's json_encode for the shapes an update value can take: strings are quoted, booleans and null keep their spelling, and slices and maps recurse. It is what the grammars bind for a json-encoded update value: SQLite and Postgres array values, and every non-expression Postgres json-selector value, scalar or not.
func RemoveLeadingBoolean ¶
RemoveLeadingBoolean strips the connector from a compiled condition group.
func TableAlias ¶
TableAlias returns the SQL alias or table name of a query source.
func UnrecognisedDriverWarning ¶
UnrecognisedDriverWarning returns the declared error to log for a driver NewGrammar does not recognise, and nil for a recognised driver or one already reported. Callers log the error as a warning rather than failing: the framework deliberately lets a connection carry a database/sql driver name with no dedicated grammar, because a driver module may bring its own, and such a connection runs on the base grammar. The warning names the driver and the recognised set, so a mistyped driver is signalled at configuration time instead of surfacing as base-grammar SQL at the database. It reports each driver at most once per process: the construction paths run per transaction and per query clone, where a repeating warning would be noise.
Types ¶
type BaseGrammar ¶
type BaseGrammar struct {
// contains filtered or unexported fields
}
BaseGrammar implements the shared parts of Laravel's query grammar. Dialects embed it and override only the methods whose SQL differs. Go embedding does not dispatch virtually, so BaseGrammar keeps a self reference to the concrete dialect and routes shared logic through it.
func NewBaseGrammar ¶
func NewBaseGrammar(prefix string) *BaseGrammar
NewBaseGrammar creates the shared grammar. Call Attach with the concrete dialect afterwards.
func (*BaseGrammar) AppendUpdateValueBinding ¶
func (g *BaseGrammar) AppendUpdateValueBinding(out []any, value any) []any
AppendUpdateValueBinding appends one assignment's binding contribution to out. A subquery value contributes the bindings of its sub-select, spliced in at the assignment's position, which is what Grammar::prepareBindingsForUpdate()'s Arr::flatten does to the bindings closure Builder::update() stores for a query value.
func (*BaseGrammar) Attach ¶
func (g *BaseGrammar) Attach(self Grammar)
Attach wires the concrete dialect so shared implementations reach its overrides.
func (*BaseGrammar) Columnize ¶
func (g *BaseGrammar) Columnize(columns []any) string
Columnize joins wrapped columns with a comma. Mirrors Grammar::columnize().
func (*BaseGrammar) CompileAggregate ¶
CompileAggregate mirrors Grammar::compileAggregate().
func (*BaseGrammar) CompileColumns ¶
func (g *BaseGrammar) CompileColumns(b core.Query, columns []any) string
CompileColumns mirrors Grammar::compileColumns().
func (*BaseGrammar) CompileComponents ¶
func (g *BaseGrammar) CompileComponents(b core.Query) []string
CompileComponents compiles each set component in Laravel's fixed order. Mirrors Grammar::compileComponents().
func (*BaseGrammar) CompileDelete ¶
func (g *BaseGrammar) CompileDelete(b core.Query) string
CompileDelete mirrors Grammar::compileDelete().
func (*BaseGrammar) CompileDeleteWithJoins ¶
CompileDeleteWithJoins mirrors Grammar::compileDeleteWithJoins().
func (*BaseGrammar) CompileDeleteWithoutJoins ¶
CompileDeleteWithoutJoins mirrors Grammar::compileDeleteWithoutJoins().
func (*BaseGrammar) CompileExists ¶
func (g *BaseGrammar) CompileExists(b core.Query) string
CompileExists mirrors Grammar::compileExists().
func (*BaseGrammar) CompileFrom ¶
func (g *BaseGrammar) CompileFrom(b core.Query, table any) string
CompileFrom mirrors Grammar::compileFrom().
func (*BaseGrammar) CompileGroupLimit ¶
func (g *BaseGrammar) CompileGroupLimit(b core.Query) string
CompileGroupLimit mirrors Grammar::compileGroupLimit().
func (*BaseGrammar) CompileGroups ¶
func (g *BaseGrammar) CompileGroups(b core.Query, groups []any) string
CompileGroups mirrors Grammar::compileGroups().
func (*BaseGrammar) CompileHaving ¶
CompileHaving mirrors Grammar::compileHaving().
func (*BaseGrammar) CompileHavings ¶
func (g *BaseGrammar) CompileHavings(b core.Query) string
CompileHavings mirrors Grammar::compileHavings().
func (*BaseGrammar) CompileIndexHint ¶
CompileIndexHint is dialect specific. The base compiles nothing.
func (*BaseGrammar) CompileInsert ¶
CompileInsert mirrors Grammar::compileInsert().
func (*BaseGrammar) CompileInsertGetId ¶
func (g *BaseGrammar) CompileInsertGetId(b core.Query, values []map[string]any, sequence string) string
CompileInsertGetId mirrors Grammar::compileInsertGetId(). Dialects that need a returning clause override this.
func (*BaseGrammar) CompileInsertOrIgnore ¶
CompileInsertOrIgnore mirrors Grammar::compileInsertOrIgnore(). The base refuses.
func (*BaseGrammar) CompileInsertOrIgnoreUsing ¶
CompileInsertOrIgnoreUsing mirrors Grammar::compileInsertOrIgnoreUsing(). The base refuses.
func (*BaseGrammar) CompileInsertUsing ¶
CompileInsertUsing mirrors Grammar::compileInsertUsing().
func (*BaseGrammar) CompileInsertWithOutput ¶
func (g *BaseGrammar) CompileInsertWithOutput(b core.Query, values []map[string]any, output string) string
CompileInsertWithOutput places a dialect's OUTPUT clause before inserted values.
func (*BaseGrammar) CompileJoinLateral ¶
func (g *BaseGrammar) CompileJoinLateral(join core.Join, expression string) string
CompileJoinLateral mirrors Grammar::compileJoinLateral(). The base does not support lateral joins and compiles nothing; CompileJoins records errLateralJoinNotSupported, mirroring the RuntimeException the base throws.
func (*BaseGrammar) CompileJoins ¶
CompileJoins mirrors Grammar::compileJoins().
func (*BaseGrammar) CompileJsonContains ¶
func (g *BaseGrammar) CompileJsonContains(column string, value string) string
func (*BaseGrammar) CompileJsonContainsKey ¶
func (g *BaseGrammar) CompileJsonContainsKey(column string) string
func (*BaseGrammar) CompileJsonLength ¶
func (g *BaseGrammar) CompileJsonLength(column string, operator string, value string) string
func (*BaseGrammar) CompileJsonOverlaps ¶
func (g *BaseGrammar) CompileJsonOverlaps(column string, value string) string
func (*BaseGrammar) CompileJsonUpdateColumn ¶
func (g *BaseGrammar) CompileJsonUpdateColumn(key string, value any) string
func (*BaseGrammar) CompileJsonValueCast ¶
func (g *BaseGrammar) CompileJsonValueCast(value string) string
CompileJsonValueCast mirrors Grammar::compileJsonValueCast(). The base is an identity.
func (*BaseGrammar) CompileLegacyGroupLimit ¶
func (g *BaseGrammar) CompileLegacyGroupLimit(b core.Query) string
CompileLegacyGroupLimit is only implemented by MySQL.
func (*BaseGrammar) CompileLimit ¶
func (g *BaseGrammar) CompileLimit(b core.Query, limit *int) string
CompileLimit mirrors Grammar::compileLimit().
func (*BaseGrammar) CompileLock ¶
func (g *BaseGrammar) CompileLock(b core.Query, value any) string
CompileLock mirrors Grammar::compileLock().
func (*BaseGrammar) CompileOffset ¶
func (g *BaseGrammar) CompileOffset(b core.Query, offset *int) string
CompileOffset mirrors Grammar::compileOffset().
func (*BaseGrammar) CompileOrders ¶
CompileOrders mirrors Grammar::compileOrders().
func (*BaseGrammar) CompileRandom ¶
func (g *BaseGrammar) CompileRandom(seed any) string
CompileRandom mirrors Grammar::compileRandom().
func (*BaseGrammar) CompileRowNumber ¶
func (g *BaseGrammar) CompileRowNumber(partition string, orders string) string
CompileRowNumber mirrors Grammar::compileRowNumber(), used by the group limit rewrite.
func (*BaseGrammar) CompileSelect ¶
func (g *BaseGrammar) CompileSelect(b core.Query) string
CompileSelect compiles a select statement. Mirrors Grammar::compileSelect().
func (*BaseGrammar) CompileTruncate ¶
func (g *BaseGrammar) CompileTruncate(b core.Query) []core.Statement
CompileTruncate mirrors Grammar::compileTruncate().
func (*BaseGrammar) CompileUnionAggregate ¶
func (g *BaseGrammar) CompileUnionAggregate(b core.Query) string
CompileUnionAggregate mirrors Grammar::compileUnionAggregate().
func (*BaseGrammar) CompileUnions ¶
func (g *BaseGrammar) CompileUnions(b core.Query) string
CompileUnions mirrors Grammar::compileUnions().
func (*BaseGrammar) CompileUpdate ¶
func (g *BaseGrammar) CompileUpdate(b core.Query, values core.UpdateValues) string
CompileUpdate mirrors Grammar::compileUpdate().
func (*BaseGrammar) CompileUpdateColumns ¶
func (g *BaseGrammar) CompileUpdateColumns(b core.Query, values core.UpdateValues) string
CompileUpdateColumns mirrors Grammar::compileUpdateColumns().
func (*BaseGrammar) CompileUpdateWithJoins ¶
func (g *BaseGrammar) CompileUpdateWithJoins(b core.Query, table string, columns string, where string) string
CompileUpdateWithJoins mirrors Grammar::compileUpdateWithJoins().
func (*BaseGrammar) CompileUpdateWithoutJoins ¶
func (g *BaseGrammar) CompileUpdateWithoutJoins(b core.Query, table string, columns string, where string) string
CompileUpdateWithoutJoins mirrors Grammar::compileUpdateWithoutJoins().
func (*BaseGrammar) CompileUpsert ¶
func (g *BaseGrammar) CompileUpsert(b core.Query, values []map[string]any, uniqueBy []string, update []core.UpsertUpdate) string
CompileUpsert mirrors Grammar::compileUpsert(). The base refuses.
func (*BaseGrammar) CompileWhere ¶
CompileWhere dispatches on the descriptor type. Mirrors Grammar::compileWheresToArray(), which builds the method name as "where{$where['type']}".
func (*BaseGrammar) CompileWheres ¶
func (g *BaseGrammar) CompileWheres(b core.Query) string
CompileWheres mirrors Grammar::compileWheres().
func (*BaseGrammar) GetBitwiseOperators ¶
func (g *BaseGrammar) GetBitwiseOperators() []string
GetBitwiseOperators returns dialect specific bitwise operators. The base adds none.
func (*BaseGrammar) GetDateFormat ¶
func (g *BaseGrammar) GetDateFormat() string
GetDateFormat returns the dialect date format. Mirrors Grammar::getDateFormat().
func (*BaseGrammar) GetOperators ¶
func (g *BaseGrammar) GetOperators() []string
GetOperators returns dialect specific operators. The base adds none.
func (*BaseGrammar) GetValue ¶
func (g *BaseGrammar) GetValue(expression core.Expression) string
GetValue returns an expression's raw SQL. Mirrors Grammar::getValue().
func (*BaseGrammar) IsJsonSelector ¶
func (g *BaseGrammar) IsJsonSelector(value string) bool
IsJsonSelector reports whether a value is a JSON selector. Mirrors Grammar::isJsonSelector().
func (*BaseGrammar) JsonFieldAndPath ¶
func (g *BaseGrammar) JsonFieldAndPath(value string) (string, string)
JsonFieldAndPath returns the quoted field and JSON path for an external dialect.
func (*BaseGrammar) Parameter ¶
func (g *BaseGrammar) Parameter(value any) string
Parameter returns the placeholder for a value. Mirrors Grammar::parameter().
func (*BaseGrammar) Parameterize ¶
func (g *BaseGrammar) Parameterize(values []any) string
Parameterize joins placeholders with a comma. Mirrors Grammar::parameterize().
func (*BaseGrammar) PrepareBindingForJsonContains ¶
func (g *BaseGrammar) PrepareBindingForJsonContains(value any) any
PrepareBindingForJsonContains normalises a JSON contains binding. The base json-encodes the value, matching Grammar::prepareBindingForJsonContains(); SQLite and SQL Server override to pass scalars through unchanged.
func (*BaseGrammar) PrepareBindingsForDelete ¶
func (g *BaseGrammar) PrepareBindingsForDelete(bindings map[string][]any) []any
PrepareBindingsForDelete mirrors Grammar::prepareBindingsForDelete().
func (*BaseGrammar) PrepareBindingsForUpdate ¶
func (g *BaseGrammar) PrepareBindingsForUpdate(bindings map[string][]any, values core.UpdateValues) []any
PrepareBindingsForUpdate mirrors Grammar::prepareBindingsForUpdate().
func (*BaseGrammar) PrepareWhereLikeBinding ¶
func (g *BaseGrammar) PrepareWhereLikeBinding(value string, caseSensitive bool) string
PrepareWhereLikeBinding normalises a like binding. The base is an identity.
func (*BaseGrammar) SelectComponents ¶
func (g *BaseGrammar) SelectComponents() []string
SelectComponents returns the clause order this dialect compiles in. Mirrors Grammar::$selectComponents.
func (*BaseGrammar) SetEscaper ¶
func (g *BaseGrammar) SetEscaper(escape func(any, bool) string)
SetEscaper supplies the connection's literal escaping, as Laravel's Grammar::escape does. SQL previews use the framework's value formatter when no connection escaper was supplied.
func (*BaseGrammar) SetValueWrapper ¶
func (g *BaseGrammar) SetValueWrapper(wrapper func(string) string)
SetValueWrapper sets the dialect's identifier quoting.
func (*BaseGrammar) SubstituteBindingsIntoRawSQL ¶
func (g *BaseGrammar) SubstituteBindingsIntoRawSQL(sql string, bindings []any) string
SubstituteBindingsIntoRawSQL ports Grammar::substituteBindingsIntoRawSql. Escaped quotes and escaped question marks do not consume bindings, nor do question marks inside string literals.
func (*BaseGrammar) UseLegacyGroupLimit ¶
func (g *BaseGrammar) UseLegacyGroupLimit(b core.Query) bool
UseLegacyGroupLimit reports whether the dialect needs the legacy group limit rewrite.
func (*BaseGrammar) WhereBasic ¶
WhereBasic mirrors Grammar::whereBasic().
func (*BaseGrammar) WhereBetween ¶
WhereBetween mirrors Grammar::whereBetween().
func (*BaseGrammar) WhereBetweenColumns ¶
WhereBetweenColumns mirrors Grammar::whereBetweenColumns().
func (*BaseGrammar) WhereBitwise ¶
WhereBitwise mirrors Grammar::whereBitwise(), which delegates to whereBasic.
func (*BaseGrammar) WhereColumn ¶
WhereColumn mirrors Grammar::whereColumn().
func (*BaseGrammar) WhereExists ¶
WhereExists mirrors Grammar::whereExists().
func (*BaseGrammar) WhereExpression ¶
WhereExpression mirrors Grammar::whereExpression().
func (*BaseGrammar) WhereFullText ¶
WhereFullText mirrors Grammar::whereFullText(). The base refuses.
func (*BaseGrammar) WhereInRaw ¶
WhereInRaw mirrors Grammar::whereInRaw().
func (*BaseGrammar) WhereJsonBoolean ¶
WhereJsonBoolean mirrors Grammar::whereJsonBoolean(). The base grammar has no JSON selector of its own, so wrapping the column comes back empty; Laravel's base grammar throws "this database engine does not support JSON operations" there, and the port records the same capability error on the builder, exactly as the JSON contains, key and length compilers do.
func (*BaseGrammar) WhereJsonContains ¶
WhereJsonContains mirrors Grammar::whereJsonContains().
func (*BaseGrammar) WhereJsonContainsKey ¶
WhereJsonContainsKey mirrors Grammar::whereJsonContainsKey().
func (*BaseGrammar) WhereJsonLength ¶
WhereJsonLength mirrors Grammar::whereJsonLength().
func (*BaseGrammar) WhereJsonOverlaps ¶
WhereJsonOverlaps mirrors Grammar::whereJsonOverlaps().
func (*BaseGrammar) WhereMonth ¶
WhereMonth mirrors Grammar::whereMonth().
func (*BaseGrammar) WhereNested ¶
WhereNested mirrors Grammar::whereNested(). The child compiles to "where ..." or "on ...", so the leading keyword is stripped by its length.
func (*BaseGrammar) WhereNotExists ¶
WhereNotExists mirrors Grammar::whereNotExists().
func (*BaseGrammar) WhereNotIn ¶
WhereNotIn mirrors Grammar::whereNotIn().
func (*BaseGrammar) WhereNotInRaw ¶
WhereNotInRaw mirrors Grammar::whereNotInRaw().
func (*BaseGrammar) WhereNotNull ¶
WhereNotNull mirrors Grammar::whereNotNull().
func (*BaseGrammar) WhereRowValues ¶
WhereRowValues mirrors Grammar::whereRowValues().
func (*BaseGrammar) WhereValueBetween ¶
WhereValueBetween mirrors Grammar::whereValueBetween().
func (*BaseGrammar) Wrap ¶
func (g *BaseGrammar) Wrap(value any) string
Wrap quotes a column or value. Mirrors Grammar::wrap().
func (*BaseGrammar) WrapJsonBooleanSelector ¶
func (g *BaseGrammar) WrapJsonBooleanSelector(value string) string
func (*BaseGrammar) WrapJsonBooleanValue ¶
func (g *BaseGrammar) WrapJsonBooleanValue(value string) string
func (*BaseGrammar) WrapJsonSelector ¶
func (g *BaseGrammar) WrapJsonSelector(value string) string
func (*BaseGrammar) WrapTable ¶
func (g *BaseGrammar) WrapTable(table any) string
WrapTable quotes a table. Mirrors Grammar::wrapTable().
func (*BaseGrammar) WrapUnion ¶
func (g *BaseGrammar) WrapUnion(sql string) string
WrapUnion mirrors Grammar::wrapUnion().
func (*BaseGrammar) WrapValue ¶
func (g *BaseGrammar) WrapValue(value string) string
WrapValue quotes a single identifier. Mirrors Grammar::wrapValue().
type Grammar ¶
type Grammar = contractsquery.Grammar
Grammar is the public contract implemented by query dialects.
func NewGrammar ¶
NewGrammar returns the grammar for a driver name. The second result reports whether the driver is recognised; an unrecognised driver yields the base grammar and false.
External dialects are supplied by their configured driver.