MCPcopy
hub / github.com/Masterminds/squirrel / TestEscapeColon

Function TestEscapeColon

placeholder_test.go:44–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

42}
43
44func TestEscapeColon(t *testing.T) {
45 sql := "SELECT uuid, \"data\" #> '{tags}' AS tags FROM nodes WHERE \"data\" -> 'tags' ??| array['?'] AND enabled = ?"
46 s, _ := Colon.ReplacePlaceholders(sql)
47 assert.Equal(t, "SELECT uuid, \"data\" #> '{tags}' AS tags FROM nodes WHERE \"data\" -> 'tags' ?| array[':1'] AND enabled = :2", s)
48}
49
50func TestEscapeAtp(t *testing.T) {
51 sql := "SELECT uuid, \"data\" #> '{tags}' AS tags FROM nodes WHERE \"data\" -> 'tags' ??| array['?'] AND enabled = ?"

Callers

nothing calls this directly

Calls 1

ReplacePlaceholdersMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…