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 Rebind ¶
Rebind returns query ready for a dialect whose placeholders are numbered (numbered true: the query is returned unchanged) or positional ("?"). Outside quoted string literals and identifiers each $N becomes "?", which is only meaningful when the placeholders appear once each, in order 1, 2, 3, …: anything else panics, since silently rebinding would change which argument goes where. RebindArgs handles a query that reuses or reorders them.
func RebindArgs ¶
RebindArgs rewrites query for a positional dialect like Rebind and 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.