MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestUpdate_SQL

Function TestUpdate_SQL

pkg/sql/ast/sql_coverage_test.go:251–262  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

249}
250
251func TestUpdate_SQL(t *testing.T) {
252 u := &Update{
253 Table: TableReference{Name: "t"},
254 Updates: []UpdateExpression{{Column: &Identifier{Name: "x"}, Value: &LiteralValue{Value: "1"}}},
255 Where: &Identifier{Name: "true"},
256 ReturningClause: []Expression{&Identifier{Name: "id"}},
257 }
258 sql := u.SQL()
259 if !strings.Contains(sql, "RETURNING id") {
260 t.Errorf("got: %s", sql)
261 }
262}
263
264func TestDelete_SQL(t *testing.T) {
265 d := &Delete{

Callers

nothing calls this directly

Calls 2

SQLMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected