Help us shape the future of Go! Take the 2026 Go Developer Survey

sqlbind

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package sqlbind writes one query with numbered placeholders ($1, $2, …) for every dialect, so tanGO's own raw SQL (migrations, tests) does not have to be duplicated per placeholder style.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RebindArgs

func RebindArgs(query string) (rewritten string, order []int)

RebindArgs rewrites query for a positional dialect: outside quoted string literals and identifiers each $N becomes "?". It also returns which numbered argument each "?" takes, 1-indexed, in order: a query that uses $1 twice returns order [1 …, 1]. A query with no numbered placeholders returns a nil order, meaning the arguments are used as given.

Types

This section is empty.

Jump to

Keyboard shortcuts

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