feat: add upload logics
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"exporter/database/telegram_resource/public/model"
|
||||
"exporter/database/telegram_resource/public/table"
|
||||
|
||||
"github.com/samber/lo"
|
||||
@@ -56,12 +57,23 @@ func Test_Join(t *testing.T) {
|
||||
if err := InitDB(dsn); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
// db.Exec(`truncate channel_messages`)
|
||||
|
||||
var msg struct {
|
||||
model.ChannelMessages
|
||||
model.Channels
|
||||
}
|
||||
tblC := table.Channels
|
||||
tbl := table.ChannelMessages
|
||||
stmt := tbl.SELECT(tbl.AllColumns, tblC.Title).
|
||||
WHERE(tbl.Published.IS_TRUE()).
|
||||
WHERE(tbl.Published.IS_FALSE()).
|
||||
LIMIT(1).
|
||||
FROM(tbl.LEFT_JOIN(tblC, tbl.ChannelID.EQ(tblC.UUID)))
|
||||
t.Log(stmt.DebugSql())
|
||||
|
||||
if err := stmt.QueryContext(context.Background(), db, &msg); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
t.Logf("%+v", msg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user