Add support for PostgreSQL interval column

This commit is contained in:
go-jet 2020-02-09 18:37:48 +01:00
parent 641c62098c
commit 3013dc3647
30 changed files with 1038 additions and 255 deletions

View file

@ -6,14 +6,19 @@ import (
_ "github.com/lib/pq"
"github.com/pkg/profile"
"os"
"os/exec"
"strings"
"testing"
)
var db *sql.DB
var testRoot string
func TestMain(m *testing.M) {
defer profile.Start().Stop()
setTestRoot()
var err error
db, err = sql.Open("postgres", dbconfig.PostgresConnectString)
if err != nil {
@ -25,3 +30,13 @@ func TestMain(m *testing.M) {
os.Exit(ret)
}
func setTestRoot() {
cmd := exec.Command("git", "rev-parse", "--show-toplevel")
byteArr, err := cmd.Output()
if err != nil {
panic(err)
}
testRoot = strings.TrimSpace(string(byteArr)) + "/tests/"
}