MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / TestPostgresDialect

Function TestPostgresDialect

internal/store/dialect_test.go:65–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestPostgresDialect(t *testing.T) {
66 d := &postgresDialect{}
67
68 if d.Driver() != DriverPostgres {
69 t.Errorf("expected DriverPostgres, got %v", d.Driver())
70 }
71 if got := d.Placeholder(3); got != "$3" {
72 t.Errorf("Placeholder(3) = %q", got)
73 }
74 if got := d.JSONExtractText("i.fields", "status"); got != "i.fields->>'status'" {
75 t.Errorf("JSONExtractText = %q", got)
76 }
77 if got := d.JSONRemove("fields", "phase"); got != "(fields::jsonb - 'phase')" {
78 t.Errorf("JSONRemove = %q", got)
79 }
80 if got := d.GroupConcat("u.name", true); got != "STRING_AGG(DISTINCT u.name, ',')" {
81 t.Errorf("GroupConcat = %q", got)
82 }
83 if got := d.ILike(); got != "ILIKE" {
84 t.Errorf("ILike = %q", got)
85 }
86}

Callers

nothing calls this directly

Calls 6

DriverMethod · 0.95
PlaceholderMethod · 0.95
JSONExtractTextMethod · 0.95
JSONRemoveMethod · 0.95
GroupConcatMethod · 0.95
ILikeMethod · 0.95

Tested by

no test coverage detected