Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultExecutionConfig = ExecutionConfig{ NumberedParameters: false, FuncName: "param", }
Functions ¶
This section is empty.
Types ¶
type Execution ¶
type Execution struct {
// contains filtered or unexported fields
}
Execution provides the "param" function for execution in templates and collects positional parameter values.
The "param" function handles different types as follows:
- Slices (e.g., []int, []string): The slice is "unrolled" into a comma-separated list of placeholders (e.g., "?, ?, ?"), and each element is added as a separate argument. This is useful for "IN" clauses.
- []byte: Treated as a single atomic parameter, not unrolled.
- driver.Valuer: Types implementing this interface are treated as single atomic parameters even if they are slices (e.g., custom JSONB types).
- All other types: Treated as a single atomic parameter.
func NewExecution ¶
func NewExecution(conf ExecutionConfig) *Execution
NewExecution creates an Execution for use with a single text/template execution using provided configuration options.
type ExecutionConfig ¶
ExecutionConfig configures options for an Execution.
Click to show internal directories.
Click to hide internal directories.