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

Function TestAddJoinFromSQL

pkg/transform/joins_test.go:50–59  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

48}
49
50func TestAddJoinFromSQL(t *testing.T) {
51 stmt := mustParse(t, "SELECT * FROM users")
52 err := Apply(stmt, AddJoinFromSQL("LEFT JOIN orders ON orders.user_id = users.id"))
53 if err != nil {
54 t.Fatal(err)
55 }
56 out := format(stmt)
57 assertContains(t, out, "LEFT JOIN")
58 assertContains(t, out, "orders")
59}
60
61func TestJoin_UnsupportedStatement(t *testing.T) {
62 stmt := mustParse(t, "DELETE FROM users")

Callers

nothing calls this directly

Calls 5

mustParseFunction · 0.85
ApplyFunction · 0.85
AddJoinFromSQLFunction · 0.85
assertContainsFunction · 0.85
formatFunction · 0.70

Tested by

no test coverage detected