feat: update
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"exporter/database/telegram_resource/public/table"
|
||||
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
||||
@@ -48,3 +50,18 @@ func TestDBChannel_SaveMessage(t *testing.T) {
|
||||
t.Logf("%+v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func Test_Join(t *testing.T) {
|
||||
dsn := "postgresql://postgres:xixi0202@10.1.1.3:5432/telegram_resource?sslmode=disable"
|
||||
if err := InitDB(dsn); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
tblC := table.Channels
|
||||
tbl := table.ChannelMessages
|
||||
stmt := tbl.SELECT(tbl.AllColumns, tblC.Title).
|
||||
WHERE(tbl.Published.IS_TRUE()).
|
||||
LIMIT(1).
|
||||
FROM(tbl.LEFT_JOIN(tblC, tbl.ChannelID.EQ(tblC.UUID)))
|
||||
t.Log(stmt.DebugSql())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user