Documentation
¶
Overview ¶
Package query executes SQL through a conn.Pool, enforcing the safety gate, single-statement rule, optional row limit, and context timeout.
Index ¶
- Variables
- func Execute(ctx context.Context, pool *conn.Pool, sqlText string, opts Options) (result.Result, error)
- func ExecuteTxn(ctx context.Context, pool *conn.Pool, statements []string, opts Options) (result.Result, error)
- func ExecuteWrite(ctx context.Context, pool *conn.Pool, sqlText string, opts Options) (result.Result, error)
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrGuard = errors.New("guard") ErrMultiStatement = errors.New("multi-statement") ErrSQL = errors.New("sql") ErrTimeout = errors.New("timeout") )
Typed errors mapped by the cli layer to exit codes.
Functions ¶
func Execute ¶
func Execute(ctx context.Context, pool *conn.Pool, sqlText string, opts Options) (result.Result, error)
Execute runs a single SQL statement. It first applies the safety guard, then the multi-statement check, then executes with the given timeout and optional LIMIT wrapping for SELECT queries.
Types ¶
Click to show internal directories.
Click to hide internal directories.