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

Function TestSQLiteDialect

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

Source from the content-addressed store, hash-verified

66}
67
68func TestSQLiteDialect(t *testing.T) {
69 t.Parallel()
70 d := &sqliteDialect{}
71
72 if d.Driver() != DriverSQLite {
73 t.Errorf("expected DriverSQLite, got %v", d.Driver())
74 }
75 if got := d.JSONExtractText("i.fields", "status"); got != "json_extract(i.fields, '$.status')" {
76 t.Errorf("JSONExtractText = %q", got)
77 }
78 if got := d.Now(); got != "datetime('now')" {
79 t.Errorf("Now = %q", got)
80 }
81 if got, _ := d.FTSMatch("items_fts", "search_vector", "hello"); got != "items_fts MATCH ?" {
82 t.Errorf("FTSMatch = %q", got)
83 }
84 if got := d.GroupConcat("u.name", true); got != "GROUP_CONCAT(DISTINCT u.name)" {
85 t.Errorf("GroupConcat = %q", got)
86 }
87}
88
89func TestPostgresDialect(t *testing.T) {
90 t.Parallel()

Callers

nothing calls this directly

Calls 5

DriverMethod · 0.95
JSONExtractTextMethod · 0.95
NowMethod · 0.95
FTSMatchMethod · 0.95
GroupConcatMethod · 0.95

Tested by

no test coverage detected