mirror of https://github.com/usememos/memos
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
408 B
Go
27 lines
408 B
Go
package postgres
|
|
|
|
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, ", ")
|
|
}
|