MCPcopy Create free account
hub / github.com/bytebase/bytebase / TestQuery_JSONBExistsAnyOperator

Function TestQuery_JSONBExistsAnyOperator

backend/common/qb/qb_test.go:321–329  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

319}
320
321func TestQuery_JSONBExistsAnyOperator(t *testing.T) {
322 // Test the ?| operator (any key exists)
323 q := Q().Space("DELETE FROM issue_comment").
324 Where("(payload->'taskUpdate')??|'{toEarliestAllowedTime, fromEarliestAllowedTime}'")
325 sql, args, err := q.ToSQL()
326 require.NoError(t, err)
327 require.Equal(t, "DELETE FROM issue_comment WHERE (payload->'taskUpdate')?|'{toEarliestAllowedTime, fromEarliestAllowedTime}'", sql)
328 require.Empty(t, args)
329}
330
331func TestQuery_JSONBExistsAllOperator(t *testing.T) {
332 // Test the ?& operator (all keys exist)

Callers

nothing calls this directly

Calls 5

QFunction · 0.85
WhereMethod · 0.80
SpaceMethod · 0.80
ToSQLMethod · 0.80
EqualMethod · 0.65

Tested by

no test coverage detected