fragment

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package fragment owns authored SQL predicate fragments and their ordered invocation bindings. SQL templates and predicate templates share this owner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dialect

func Dialect(ctx context.Context) *info.Dialect

func WithDialect

func WithDialect(ctx context.Context, dialect *info.Dialect) context.Context

WithDialect scopes pure SQL rendering metadata to nested predicate evaluation. It carries no database/transaction handle or execution service.

Types

type Bindings

type Bindings struct {
	// contains filtered or unexported fields
}

func (*Bindings) Add

func (b *Bindings) Add(value any) (string, error)

func (*Bindings) Append

func (b *Bindings) Append(values ...any)

func (*Bindings) Args

func (b *Bindings) Args() []any

type Context

type Context struct {
	// contains filtered or unexported fields
}

func New

func New(bindings *Bindings) *Context

func (*Context) AppendBinding

func (c *Context) AppendBinding(value any) (string, error)

func (*Context) CompositeIn

func (c *Context) CompositeIn(alias string, rows any) (string, error)

CompositeIn renders a fixed tuple predicate from typed key records. SQLX owns column mapping and dialect syntax; all mapped fields participate even when their values are zero, false or null. Callers supply a key projection, not arbitrary mutable entity fields. Empty input is a no-match predicate.

func (*Context) Contains

func (c *Context) Contains(column string, value any) (string, error)

func (*Context) Expression

func (c *Context) Expression(expression string, value any) (string, error)

Expression follows authored Datly semantics: an empty string omits the expression, while zero numbers, false and NULL remain actual bound values.

func (*Context) In

func (c *Context) In(column string, value any) (string, error)

func (*Context) Like

func (c *Context) Like(column string, value any) (string, error)

func (*Context) NotContains

func (c *Context) NotContains(column string, value any) (string, error)

func (*Context) NotIn

func (c *Context) NotIn(column string, value any) (string, error)

func (*Context) NotLike

func (c *Context) NotLike(column string, value any) (string, error)

func (*Context) WithDialect

func (c *Context) WithDialect(dialect *info.Dialect) *Context

WithDialect configures rendering on a copied context while retaining the invocation's single ordered binding collector.

Jump to

Keyboard shortcuts

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