fix group msg

This commit is contained in:
Rogee
2024-09-03 09:43:21 +08:00
parent ba16785b43
commit df2ca18f19
5 changed files with 138 additions and 28 deletions

View File

@@ -4,7 +4,10 @@ import (
"mime"
"testing"
"exporter/database/telegram_resource/public/table"
"github.com/dustin/go-humanize"
. "github.com/go-jet/jet/v2/postgres"
"github.com/spf13/viper"
)
@@ -27,3 +30,17 @@ func Test_Size(t *testing.T) {
t.Logf("Size: %d", s)
t.Logf("Vize: %d", b)
}
func Test_Sql(t *testing.T) {
tbl := table.ChannelMessages
stmt := tbl.UPDATE().SET(
tbl.Content.SET(RawString(`CONCAT(content, $var)`, RawArgs{"$var": "hello"})),
tbl.Media.SET(RawString(`media || $var::jsonb`, RawArgs{"$var": `{"Rogee": "Hello"}`})),
).WHERE(
tbl.GroupID.EQ(Int(1)).AND(
tbl.UUID.EQ(Int64(1)),
),
)
t.Log(stmt.DebugSql())
}