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

Function TestQuery_JSONBExistsOperator

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

Source from the content-addressed store, hash-verified

309}
310
311func TestQuery_JSONBExistsOperator(t *testing.T) {
312 // Test the ? operator (key existence check)
313 q := Q().Space("SELECT * FROM tasks").
314 Where("payload ?? 'schema_version'")
315 sql, args, err := q.ToSQL()
316 require.NoError(t, err)
317 require.Equal(t, "SELECT * FROM tasks WHERE payload ? 'schema_version'", sql)
318 require.Empty(t, args)
319}
320
321func TestQuery_JSONBExistsAnyOperator(t *testing.T) {
322 // Test the ?| operator (any key exists)

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