Files
qvyun/test/main_test.go
2025-01-17 14:59:54 +08:00

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())
}