Documentation
¶
Index ¶
- func Alias(table, column string) string
- func Collect(ctx context.Context, f Fragment) (string, []any)
- func IsNil(e Fragment) bool
- func NonNil[F Fragment](seq iter.Seq[F]) iter.Seq[Fragment]
- type CustomValueArg
- type Fragment
- func Arg(v any) Fragment
- func ArgIterFunc(v any) Fragment
- func Block(f Fragment) Fragment
- func BlockWithoutBrackets(seq iter.Seq[Fragment]) Fragment
- func Compose(sep string, frags ...Fragment) Fragment
- func ComposeSeq(sep string, frags iter.Seq[Fragment]) Fragment
- func Empty() Fragment
- func Func(f func(context.Context) Iter) Fragment
- func Lit(q string) Fragment
- func Query(query string, args ...any) Fragment
- type Iter
- type NamedArg
- type NamedArgs
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Alias ¶
Alias generates a deterministic alias name for a given table and column. If the combined length is shorter than 64 characters (minus separators), it returns a simple "table__column" alias. Otherwise, it generates a hashed form using a cached SHA1-based abbreviation to keep the alias short and stable.
Types ¶
type CustomValueArg ¶
type CustomValueArg interface {
ValueEx() string
}
CustomValueArg supports replacing ? to some sql snippet eg: ? => UPPER(?)
type Fragment ¶
Fragment defines an interface to present a sql fragment
func ArgIterFunc ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.