Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Criteria ¶ added in v0.26.1
Criteria is a parameterized SQL predicate produced by a trusted compiler or predicate handler. It contains a Boolean expression, never a WHERE keyword. Driver placeholder rewriting and argument-count validation are shared by reads and mutations; clients must not supply arbitrary SQL through this contract.
type ParameterBinder ¶ added in v0.26.0
type ParameterBinder struct {
// contains filtered or unexported fields
}
ParameterBinder binds successive SQL fragments while preserving consumption order of the shared positional arguments. Complete verifies full consumption.
func NewParameterBinder ¶ added in v0.26.0
func NewParameterBinder(resolver ParameterResolver, positional ...any) *ParameterBinder
func (*ParameterBinder) Bind ¶ added in v0.26.0
func (b *ParameterBinder) Bind(SQL string) (string, []any, error)
func (*ParameterBinder) Complete ¶ added in v0.26.0
func (b *ParameterBinder) Complete() error
type ParameterResolver ¶ added in v0.26.0
ParameterResolver resolves one named SQL value from an invocation scope.
type Parameters ¶ added in v0.26.0
type Parameters struct {
SQL string
// contains filtered or unexported fields
}
Parameters preserves SQL text and the positions of executable ? and :name placeholders. SQLparser owns quoted strings, comments and identifier regions.
func ParseParameters ¶ added in v0.26.0
func ParseParameters(SQL string) *Parameters
func (*Parameters) Count ¶ added in v0.26.0
func (p *Parameters) Count() int
func (*Parameters) ExpandSinglePositional ¶ added in v0.26.0
func (p *Parameters) ExpandSinglePositional(count int) string
ExpandSinglePositional expands the sole executable positional placeholder. Existing named placeholders, literal text and comments remain byte-for-byte.
func (*Parameters) HasPositional ¶ added in v0.26.0
func (p *Parameters) HasPositional() bool
func (*Parameters) NamedCount ¶ added in v0.26.0
func (p *Parameters) NamedCount() int
func (*Parameters) PositionalCount ¶ added in v0.26.0
func (p *Parameters) PositionalCount() int
func (*Parameters) RewritePositional ¶ added in v0.26.1
func (p *Parameters) RewritePositional(replace func(int) string) string
RewritePositional replaces executable positional placeholders in source order. The callback receives their zero-based ordinal. Named parameters, operators, quoted regions and comments remain unchanged; the parsed source is not mutated.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
schema
Package schema provisions tables and extracts/applies explicit native schema artifacts.
|
Package schema provisions tables and extracts/applies explicit native schema artifacts. |
|
sequence
Package sequence owns transaction-bound scoped numeric allocation.
|
Package sequence owns transaction-bound scoped numeric allocation. |
|
testutil
|
|
|
reservationdb
Package reservationdb owns isolated live MySQL/PostgreSQL acceptance fixtures.
|
Package reservationdb owns isolated live MySQL/PostgreSQL acceptance fixtures. |
|
sqlfault
Package sqlfault injects read failures around real database drivers in tests.
|
Package sqlfault injects read failures around real database drivers in tests. |