Add test for join subquery
This commit is contained in:
parent
22aef2cd32
commit
4ce7974f57
|
@ -377,4 +377,11 @@ func TestJoinWithSubQuery(t *testing.T) {
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.EqualValues(t, 1, len(querys))
|
assert.EqualValues(t, 1, len(querys))
|
||||||
assert.EqualValues(t, q, querys[0])
|
assert.EqualValues(t, q, querys[0])
|
||||||
|
|
||||||
|
querys = make([]JoinWithSubQuery1, 0, 1)
|
||||||
|
err = testEngine.Join("INNER", "(SELECT id FROM `join_with_sub_query_depart`) join_with_sub_query_depart", "join_with_sub_query_depart.id = join_with_sub_query1.depart_id").
|
||||||
|
Find(&querys)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.EqualValues(t, 1, len(querys))
|
||||||
|
assert.EqualValues(t, q, querys[0])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue