sqlfrag

package
v0.0.0-...-7c93a10 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

+gengo:runtimedoc=false

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collect

func Collect(ctx context.Context, f Fragment) (string, []any)

func IsNil

func IsNil(e Fragment) bool

func Map

func Map[I any, O Fragment](seq iter.Seq[I], mapper func(i I) O) iter.Seq[Fragment]

func NonNil

func NonNil[F Fragment](fragSeq iter.Seq[F]) iter.Seq[Fragment]

Types

type Const

type Const string

func (Const) Frag

func (v Const) Frag(ctx context.Context) iter.Seq2[string, []any]

func (Const) IsNil

func (v Const) IsNil() bool

type ContextInjector

type ContextInjector interface {
	InjectContext(ctx context.Context) context.Context
}

type CustomValueArg

type CustomValueArg interface {
	ValueEx() string
}

CustomValueArg replace ? as some query snippet

examples: ? => ST_GeomFromText(?)

type Fragment

type Fragment interface {
	IsNil() bool
	Frag(ctx context.Context) iter.Seq2[string, []any]
}

func Block

func Block(fragment Fragment) Fragment

func BlockWithoutBrackets

func BlockWithoutBrackets(seq iter.Seq[Fragment]) Fragment

func Empty

func Empty() Fragment

func InlineBlock

func InlineBlock(fragment Fragment) Fragment

func Join

func Join(splitter string, fragSeq iter.Seq[Fragment]) Fragment

func JoinValues

func JoinValues(splitter string, fragments ...Fragment) Fragment

func Pair

func Pair(query string, args ...any) Fragment

func WithContextInjector

func WithContextInjector(injector ContextInjector, fragment Fragment) Fragment

type Func

type Func func(ctx context.Context) iter.Seq2[string, []any]

func (Func) Frag

func (fn Func) Frag(ctx context.Context) iter.Seq2[string, []any]

func (Func) IsNil

func (Func) IsNil() bool

type NamedArg

type NamedArg = sql.NamedArg

type NamedArgSet

type NamedArgSet map[string]any

type Values

type Values[T any] iter.Seq[T]

func (Values[T]) Frag

func (seq Values[T]) Frag(ctx context.Context) iter.Seq2[string, []any]

func (Values[T]) IsNil

func (seq Values[T]) IsNil() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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