MCPcopy
hub / github.com/ent/ent / TestUpdateBuilder_OrderBy

Function TestUpdateBuilder_OrderBy

dialect/sql/builder_test.go:2129–2138  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2127}
2128
2129func TestUpdateBuilder_OrderBy(t *testing.T) {
2130 u := Dialect(dialect.MySQL).Update("users").Set("id", Expr("`id` + 1")).OrderBy("id")
2131 require.NoError(t, u.Err())
2132 query, args := u.Query()
2133 require.Nil(t, args)
2134 require.Equal(t, "UPDATE `users` SET `id` = `id` + 1 ORDER BY `id`", query)
2135
2136 u = Dialect(dialect.Postgres).Update("users").Set("id", Expr("id + 1")).OrderBy("id")
2137 require.Error(t, u.Err())
2138}
2139
2140func TestUpdateBuilder_WithPrefix(t *testing.T) {
2141 u := Dialect(dialect.MySQL).

Callers

nothing calls this directly

Calls 8

DialectFunction · 0.85
ExprFunction · 0.70
ErrMethod · 0.65
QueryMethod · 0.65
ErrorMethod · 0.65
OrderByMethod · 0.45
SetMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…