sqlutil

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Rollback

func Rollback(tx *sql.Tx)

Rollback safely rolls back a transaction and ignores rollback errors.

func ValidateIdentifier

func ValidateIdentifier(label, value string) error

ValidateIdentifier ensures an identifier is non-empty and composed of safe SQL identifier parts. Supports schema-qualified names in the form `schema.table`.

Types

type Dialect

type Dialect string

Dialect controls SQL placeholder formatting.

const (
	DialectPostgres Dialect = "postgres"
	DialectSQLite   Dialect = "sqlite"
)

type PlaceholderFunc

type PlaceholderFunc func(int) string

PlaceholderFunc formats a placeholder for a 1-based parameter index.

func PlaceholderFor

func PlaceholderFor(dialect Dialect) PlaceholderFunc

PlaceholderFor returns a dialect-aware placeholder formatter.

Jump to

Keyboard shortcuts

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