镜像自地址
https://github.com/therootcompany/telebit.git
已同步 2025-07-01 18:06:35 +00:00
WIP SQL test
这个提交包含在:
父节点
e075d319de
当前提交
7fb9fff11b
@ -0,0 +1,14 @@
|
||||
package authstore
|
||||
|
||||
import "strings"
|
||||
|
||||
var connStr = "postgres://postgres:postgres@localhost/postgres"
|
||||
|
||||
func init() {
|
||||
// TODO url.Parse
|
||||
if strings.Contains(connStr, "@localhost/") || strings.Contains(connStr, "@localhost:") {
|
||||
connStr += "?sslmode=disable"
|
||||
} else {
|
||||
connStr += "?sslmode=required"
|
||||
}
|
||||
}
|
@ -2,22 +2,12 @@ package authstore
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestStore(t *testing.T) {
|
||||
// Note: test output is cached (running twice will not result in two records)
|
||||
|
||||
connStr := "postgres://postgres:postgres@localhost/postgres"
|
||||
if strings.Contains(connStr, "@localhost/") || strings.Contains(connStr, "@localhost:") {
|
||||
connStr += "?sslmode=disable"
|
||||
} else {
|
||||
connStr += "?sslmode=required"
|
||||
}
|
||||
|
||||
// TODO url.Parse
|
||||
|
||||
store, err := NewStore(connStr, initSQL)
|
||||
if nil != err {
|
||||
t.Fatal("connection error", err)
|
||||
|
正在加载...
x
在新工单中引用
屏蔽一个用户