Documentation ¶
Index ¶
- Constants
- func BuildQuery(q litsql.Query, options ...BuildQueryOption) (string, []any, error)
- func MergeClauses[T litsql.QueryClause](clauses ...T) (T, error)
- func NewClauseError(f string, args ...any) error
- func NewClauseErrorInvalidMerge(clauseName string) error
- func NewClauseErrorInvalidMergeCannotHaveMultiple(clauseName string) error
- func NewClauseErrorInvalidMergeHasChanges(clauseName string) error
- func NewClauseErrorWrap(err error) error
- func NewWriter(w io.Writer, options ...WriterOption) litsql.Writer
- func ParseArgValues(args []any, values ...litsql.ArgValues) ([]any, error)
- func ParseArgs(args []any, values ...any) ([]any, error)
- func ToAnySlice[T any, Ts ~[]T](slice Ts) []any
- type BuildQueryOption
- type WriterIO
- type WriterOption
Constants ¶
View Source
const ( Space = " " NewLine = "\n" OpenPar = "(" ClosePar = ")" Comma = "," CommaSpace = ", " )
Variables ¶
This section is empty.
Functions ¶
func BuildQuery ¶ added in v0.4.1
BuildQuery builds a query string and its arguments.
func MergeClauses ¶ added in v0.4.0
func MergeClauses[T litsql.QueryClause](clauses ...T) (T, error)
MergeClauses merge all clauses into the first one in the list.
func NewClauseError ¶ added in v0.3.2
func NewClauseErrorInvalidMerge ¶ added in v0.4.0
func NewClauseErrorInvalidMergeCannotHaveMultiple ¶ added in v0.4.0
func NewClauseErrorInvalidMergeHasChanges ¶ added in v0.4.0
func NewClauseErrorWrap ¶ added in v0.3.2
func ParseArgValues ¶ added in v0.4.2
ParseArgValues replaces all litsql.Argument instances in args with named values.
func ParseArgs ¶ added in v0.4.2
ParseArgs replaces all litsql.Argument instances in args with named values.
func ToAnySlice ¶
Types ¶
type BuildQueryOption ¶ added in v0.4.2
type BuildQueryOption func(options *buildQueryOptions)
func WithBuildQueryParseArgValues ¶ added in v0.4.2
func WithBuildQueryParseArgValues(argValues ...litsql.ArgValues) BuildQueryOption
WithBuildQueryParseArgValues adds named argument values.
func WithBuildQueryParseArgs ¶ added in v0.4.2
func WithBuildQueryParseArgs(argValues ...any) BuildQueryOption
WithBuildQueryParseArgs adds named argument values.
func WithBuildQueryWriterOptions ¶ added in v0.4.2
func WithBuildQueryWriterOptions(writerOptions ...WriterOption) BuildQueryOption
WithBuildQueryWriterOptions adds writer options.
type WriterIO ¶
type WriterIO struct {
// contains filtered or unexported fields
}
func WewWriterIO ¶
type WriterOption ¶ added in v0.3.5
type WriterOption func(*writer)
func WithWriterIndentStr ¶ added in v0.3.5
func WithWriterIndentStr(indentStr string) WriterOption
WithWriterIndentStr sets the indent string (used only if WithWriterUseNewLine is true). Default is " " (two spaces).
func WithWriterUseNewLine ¶ added in v0.3.5
func WithWriterUseNewLine(useNewLine bool) WriterOption
WithWriterUseNewLine sets whether to use newlines in the output or not. Default is true.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.