feat: update

This commit is contained in:
Rogee
2024-09-04 11:46:58 +08:00
parent 676b31bed3
commit a035a63f52
8 changed files with 154 additions and 12 deletions

View File

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