21 lines
373 B
Go
21 lines
373 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"test/database/models/qvyun_v2/public/table"
|
|
|
|
. "github.com/go-jet/jet/v2/postgres"
|
|
)
|
|
|
|
func Test_Join(t *testing.T) {
|
|
t1 := table.Medias
|
|
t2 := table.UserMedias
|
|
|
|
stmt := SELECT(t1.AllColumns).
|
|
FROM(
|
|
t1.RIGHT_JOIN(t2, t2.UserID.EQ(Int64(10)).AND(t2.TenantID.EQ(Int64(1)).AND(t2.MediaID.EQ(t1.ID)))),
|
|
)
|
|
t.Log(stmt.DebugSql())
|
|
}
|