rawsql

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Overview

Package rawsql interpolates bind arguments into SQL text for debugging. The result is NOT injection-safe: never execute or log it in production.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Interpolate

func Interpolate(sql string, args []any, numbered bool) string

Interpolate substitutes args for the placeholders in sql: "$1", "$2", ... when numbered, otherwise each "?" in order. Text inside '…', "…" and `…` is left alone, so a literal such as '?' or '$1' is never mistaken for a placeholder. It is best effort: backslash escapes and dollar-quoted strings are not parsed.

func Literal

func Literal(v any) string

Literal renders v as a SQL literal (strings and bytes quoted with ' doubled).

Types

This section is empty.

Jump to

Keyboard shortcuts

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