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

Function TestQuery_WithParameters

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

Source from the content-addressed store, hash-verified

15}
16
17func TestQuery_WithParameters(t *testing.T) {
18 q := Q().Space("SELECT * FROM users").Where("id = ?", 123)
19 sql, args, err := q.ToSQL()
20 require.NoError(t, err)
21 require.Equal(t, "SELECT * FROM users WHERE id = $1", sql)
22 require.Equal(t, []any{123}, args)
23}
24
25func TestQuery_MultipleParameters(t *testing.T) {
26 q := Q().Space("SELECT * FROM users").

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