Documentation
¶
Overview ¶
Package sqlcallback contains application callbacks before SQL inspects errors.
Index ¶
- func Argument(value any) any
- func Connector(source driver.Connector) driver.Connector
- func Decode[T any](operation string, decode func(any) (T, error), source any, trusted bool) (T, error)
- func Destinations(values []any) []any
- func Invoke(operation string, fn func() error) error
- func NewScanner[T any](decode func(any) (T, error), destination *T, trusted bool) sql.Scanner
- func Retain(foreign, result error) error
- type RowBatch
- type ScanBuffer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Argument ¶
Argument protects SQL's recursive pointer conversion without changing ordinary values.
func Decode ¶
func Decode[T any](operation string, decode func(any) (T, error), source any, trusted bool) (T, error)
Decode publishes only complete values. The trusted capability is supplied only by the codec owner's private framework constructor, never by applications.
func Destinations ¶
Destinations intercepts Scanner callbacks, including database/sql's pointer allocation path.
func NewScanner ¶
NewScanner retains the codec owner's capability. Its public Scan preserves error identity; its native SQL view seals causes until the database owner regains control. Both views use the same allocation and destination. Keep the destination closure shared across codec call sites. Inlining this constructor replicates generic closures in every column/aggregate adapter.
Types ¶
type RowBatch ¶
type RowBatch struct {
// contains filtered or unexported fields
}
RowBatch lends Next containment to a complete collection. The database owner must hold its stream mutex throughout Run, including callback exit and cleanup. ScanColumn and Close never borrow it: foreign scan/close frames need their own Goexit containment to release locks before returning to the collection owner.
func WithRowBatch ¶
WithRowBatch delivers a private lease to the connector wrapper. It is removed before calling an application driver, so nested/retained driver contexts cannot borrow another stream's containment.
type ScanBuffer ¶
type ScanBuffer struct {
// contains filtered or unexported fields
}
ScanBuffer owns adapter scratch for one sequential stream. It never mutates or retains the caller's slice; Reset drops retained destinations on closure.
func (*ScanBuffer) Prepare ¶
func (b *ScanBuffer) Prepare(values []any) []any
func (*ScanBuffer) Reset ¶
func (b *ScanBuffer) Reset()