Documentation
¶
Index ¶
- func ColOf(model any, fieldPtr any) string
- func MarshalClause(c Clause) string
- func NormalizeClauseSQL(sql string, qualifiers ...ClauseQualifier) string
- func StripStorageBucketFilter(sql string, bucketName string) string
- func TableFromModel(model any) (schema, table string)
- type Clause
- func And(cs ...Clause) Clause
- func ArrayContainedBy(col string, arr Exp) Clause
- func ArrayContains(col string, arr Exp) Clause
- func ArrayOverlaps(col string, arr Exp) Clause
- func Between(col string, low, high Exp) Clause
- func ContainsText(col, needle string) Clause
- func EndsWith(col, suffix string) Clause
- func Eq(col string, rhs Exp) Clause
- func EqAll(col string, arr Exp) Clause
- func EqAny(col string, arr Exp) Clause
- func EqS(col, s string) Clausedeprecated
- func EqString(col, s string) Clause
- func Exists(rawSelectSQL string) Clause
- func ExistsFrom(table string, joinCond Clause, extra ...Clause) Clause
- func Ge(col string, rhs Exp) Clause
- func Gt(col string, rhs Exp) Clause
- func ILike(col, pattern string) Clause
- func IRegex(col, re string) Clause
- func If(cond bool, c Clause) Clause
- func IfString(notEmpty string, f func(string) Clause) Clause
- func In(col string, items ...Exp) Clause
- func InOrg(col string) Clause
- func InS(col string, values ...string) Clausedeprecated
- func InStrings(col string, values ...string) Clause
- func IsDistinctFrom(col string, rhs Exp) Clause
- func IsFalse(col string) Clause
- func IsNotDistinctFrom(col string, rhs Exp) Clause
- func IsNull(col string) Clause
- func IsTrue(col string) Clause
- func JSONContains(col string, json Exp) Clause
- func JSONHasAllKeys(col string, keys ...string) Clause
- func JSONHasAnyKeys(col string, keys ...string) Clause
- func JSONHasKey(col, key string) Clause
- func Le(col string, rhs Exp) Clause
- func Like(col, pattern string) Clause
- func Lt(col string, rhs Exp) Clause
- func Ne(col string, rhs Exp) Clause
- func Not(c Clause) Clause
- func NotBetween(col string, low, high Exp) Clause
- func NotExists(rawSelectSQL string) Clause
- func NotILike(col, pattern string) Clause
- func NotIn(col string, items ...Exp) Clause
- func NotLike(col, pattern string) Clause
- func NotNull(col string) Clause
- func Or(cs ...Clause) Clause
- func OwnerIsAuth(col string) Clause
- func RangeContainedBy(col string, rhs Exp) Clause
- func RangeContains(col string, rhs Exp) Clause
- func RangeOverlaps(col string, rhs Exp) Clause
- func Regex(col, re string) Clause
- func RoleIs(role string) Clause
- func RolesAny(roles ...string) Clause
- func Search(col, q, config string) Clause
- func StartsWith(col, prefix string) Clause
- func StorageBucketClause(bucketName string) Clause
- func StorageCheckClause(bucketName string, clause Clause) Clause
- func StorageUsingClause(bucketName string, clause Clause) Clause
- func TenantMatch(col string, settingKey, cast string) Clause
- func TsMatches(vector Exp, query Exp) Clause
- func UnmarshalClause(sql string, qualifiers ...ClauseQualifier) (Clause, string, bool)
- type ClauseQualifier
- type Exp
- func Array(items ...Exp) Exp
- func ArrayStrings(values ...string) Exp
- func AuthUID() Exp
- func Bool(b bool) Exp
- func Cast(rhs Exp, typ string) Exp
- func Claim(key string) Exp
- func Coalesce(args ...Exp) Exp
- func CurrentSetting(key string) Exp
- func CurrentSettingAs(key, typ string) Exp
- func CurrentSettingCast(key, cast string) Expdeprecated
- func CurrentUser() Exp
- func Date(s string) Exp
- func F64(f float64) Expdeprecated
- func Float64(f float64) Exp
- func Func(name string, args ...Exp) Exp
- func I64(n int64) Expdeprecated
- func Ident(name string) Exp
- func Int64(n int64) Exp
- func Interval(s string) Exp
- func JSONB(s string) Exp
- func JSONGet(col, key string) Exp
- func JSONGetText(col, key string) Exp
- func JSONPath(col string, path ...string) Exp
- func JSONPathText(col string, path ...string) Exp
- func Now() Exp
- func NullIf(a, b Exp) Exp
- func Raw(s string) Exp
- func S(s string) Expdeprecated
- func SessionUser() Exp
- func String(s string) Exp
- func Timestamp(s string) Exp
- func Timestamptz(s string) Exp
- func TsVector(doc Exp, config ...string) Exp
- func UUID(s string) Exp
- func UUIDLit(s string) Expdeprecated
- func Val(s string) Expdeprecated
- func WebSearchQuery(q string, config ...string) Exp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalClause ¶
func NormalizeClauseSQL ¶
func NormalizeClauseSQL(sql string, qualifiers ...ClauseQualifier) string
func StripStorageBucketFilter ¶
StripStorageBucketFilter removes the default bucket filter from a raw clause so that generator routines can rebuild it using StorageUsingClause or StorageCheckClause.
func TableFromModel ¶
Types ¶
type Clause ¶
type Clause string // boolean expression fragment
func ArrayContainedBy ¶
func ArrayContains ¶
func ArrayOverlaps ¶
func ContainsText ¶
func ExistsFrom ¶
Common pattern: EXISTS (SELECT 1 FROM schema.table t WHERE joinCond AND extra...)
func IsDistinctFrom ¶
func IsNotDistinctFrom ¶
func JSONContains ¶
func JSONHasAllKeys ¶
func JSONHasAnyKeys ¶
func JSONHasKey ¶
func NotBetween ¶
func OwnerIsAuth ¶
func RangeContainedBy ¶
func RangeContains ¶
func RangeOverlaps ¶
func StartsWith ¶
func StorageBucketClause ¶
StorageBucketClause returns the canonical bucket scope clause for Supabase storage policies.
func StorageCheckClause ¶
StorageCheckClause ensures the storage policy CHECK clause is scoped to the bucket. Additional constraints are AND-ed to the required bucket filter, preserving pre-existing filters.
func StorageUsingClause ¶
StorageUsingClause ensures the storage policy USING clause is scoped to the bucket. Additional constraints are AND-ed to the required bucket filter, preserving pre-existing filters.
func TenantMatch ¶
func UnmarshalClause ¶
func UnmarshalClause(sql string, qualifiers ...ClauseQualifier) (Clause, string, bool)
type ClauseQualifier ¶
type Exp ¶
type Exp string // RHS literal or trusted function/expression
func ArrayStrings ¶
func CurrentSetting ¶
func CurrentSettingAs ¶
CurrentSettingAs casts current_setting(key) to a given type (if safe).
func CurrentSettingCast
deprecated
func CurrentUser ¶
func CurrentUser() Exp
func JSONGetText ¶
func JSONPathText ¶
func SessionUser ¶
func SessionUser() Exp