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

Function TestQuery_NoParameters

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

Source from the content-addressed store, hash-verified

67}
68
69func TestQuery_NoParameters(t *testing.T) {
70 q := Q().Space("SELECT * FROM users").
71 Where("TRUE").
72 And("deleted_at IS NULL")
73 sql, args, err := q.ToSQL()
74 require.NoError(t, err)
75 require.Equal(t, "SELECT * FROM users WHERE TRUE AND deleted_at IS NULL", sql)
76 require.Empty(t, args)
77}
78
79func TestQuery_ComplexConditions(t *testing.T) {
80 q := Q().Space("SELECT * FROM revision").

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected