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

Method JSONArrayContains

internal/store/dialect.go:144–144  ·  view source on GitHub ↗

JSONArrayContains returns SQL + the arg to check if a JSON array column contains a given text value, compared exactly (case and all). SQLite: a json_each element of type text equal to the arg, on a valid JSON array (a malformed row matches nothing rather than erroring). PostgreSQL: "column::jsonb @>

(column, value string)

Source from the content-addressed store, hash-verified

142 // Postgres built the JSON by hand, so a quote made invalid JSON and
143 // `a","b` asked for two elements.
144 JSONArrayContains(column, value string) (string, interface{})
145
146 // JSONArrayElements returns a FROM-clause table-function fragment that
147 // unnests a JSON text-array column into one row per element, plus the

Callers 3

ListDocumentsMethod · 0.65
listItemsQMethod · 0.65
listItemsFTSMethod · 0.65

Implementers 2

sqliteDialectinternal/store/dialect.go
postgresDialectinternal/store/dialect.go

Calls

no outgoing calls

Tested by

no test coverage detected