sqlutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EscapeLiteral

func EscapeLiteral(s string) string

EscapeLiteral doubles single quotes so a value can be embedded inside a single-quoted SQL string literal. Every current consumer renders DuckDB SQL, where backslashes in a plain '…' literal are always ordinary characters, so doubling quotes is the entire rule. PostgreSQL matches that behavior under standard_conforming_strings=on (the default since 9.1) — a consumer targeting a PostgreSQL literal with that setting off would need backslash handling this helper deliberately does not do. It does not add the surrounding quotes, and it is only correct for string-literal context — use SanitizeIdentifier for identifiers.

This is the single home of the rule; #307 showed it is load-bearing (an unescaped credential in postgres_scan('…') put deployment-configured text into SQL structure), and #310 consolidated the copies that previously lived in internal/cdc, internal/sqlgen, and the federated e2e harness.

func SanitizeIdentifier

func SanitizeIdentifier(name string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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