mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: fix postgres stmts
This commit is contained in:
@ -1,9 +1,26 @@
|
||||
package postgres
|
||||
|
||||
import "google.golang.org/protobuf/encoding/protojson"
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
)
|
||||
|
||||
var (
|
||||
protojsonUnmarshaler = protojson.UnmarshalOptions{
|
||||
DiscardUnknown: true,
|
||||
}
|
||||
)
|
||||
|
||||
func placeholder(n int) string {
|
||||
return "$" + fmt.Sprint(n)
|
||||
}
|
||||
|
||||
func placeholders(n int) string {
|
||||
list := []string{}
|
||||
for i := 0; i < n; i++ {
|
||||
list = append(list, placeholder(i+1))
|
||||
}
|
||||
return strings.Join(list, ", ")
|
||||
}
|
||||
|
Reference in New Issue
Block a user