fix group msg
This commit is contained in:
17
main_test.go
17
main_test.go
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user