MCPcopy Create free account
hub / github.com/araddon/qlbridge / testSubselect

Function testSubselect

exec/exec_test.go:497–522  ·  view source on GitHub ↗

sub-select not implemented in exec yet

(t *testing.T)

Source from the content-addressed store, hash-verified

495
496// sub-select not implemented in exec yet
497func testSubselect(t *testing.T) {
498 sqlText := `
499 select
500 user_id, email
501 FROM users
502 WHERE user_id in
503 (select user_id from orders)
504 `
505 ctx := td.TestContext(sqlText)
506 job, err := exec.BuildSqlJob(ctx)
507 assert.True(t, err == nil, "no error %v", err)
508
509 //writeCtx := NewContextSimple()
510 msgs := make([]schema.Message, 0)
511 go func() {
512 outChan := job.DrainChan()
513 for msg := range outChan {
514 u.Infof("msg: %v", msg)
515 msgs = append(msgs, msg)
516 }
517 }()
518 err = job.Run()
519 time.Sleep(time.Millisecond * 30)
520 assert.True(t, err == nil, "no error %v", err)
521 assert.True(t, len(msgs) == 1, "should have filtered out 2 messages")
522}

Callers

nothing calls this directly

Calls 3

BuildSqlJobFunction · 0.92
DrainChanMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected