MCPcopy
hub / github.com/pocketbase/pocketbase / TestJSONEach

Function TestJSONEach

tools/dbutils/json_test.go:9–17  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestJSONEach(t *testing.T) {
10 result := dbutils.JSONEach("a.b")
11
12 expected := "json_each(CASE WHEN iif(json_valid([[a.b]]), json_type([[a.b]])='array', FALSE) THEN [[a.b]] ELSE json_array([[a.b]]) END)"
13
14 if result != expected {
15 t.Fatalf("Expected\n%v\ngot\n%v", expected, result)
16 }
17}
18
19func TestJSONArrayLength(t *testing.T) {
20 result := dbutils.JSONArrayLength("a.b")

Callers

nothing calls this directly

Calls 1

JSONEachFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…