sqlutil

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertNamedToPgPlaceholders

func ConvertNamedToPgPlaceholders(sql string, named map[string]any) (string, []any, error)

ConvertNamedToPgPlaceholders converts :name placeholders into $1, $2, ... and returns ordered args. Rules: - Named identifiers must match [A-Za-z_][A-Za-z0-9_]* - Occurrences inside single-quoted string literals are ignored - For slice/array values, expands to multiple placeholders separated by ", " - Repeated scalar names reuse the same placeholder index - Repeated slice names are not supported and will error to avoid ambiguous expansion

func ConvertQMarksToPgPlaceholders

func ConvertQMarksToPgPlaceholders(s string) string

ConvertQMarksToPgPlaceholders converts '?' placeholders to PostgreSQL-style $1, $2, ...

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL