Add SQLBuilder support for SQLite databases.

This commit is contained in:
go-jet 2021-10-21 13:39:24 +02:00
parent d197956271
commit e8f4c2b31b
50 changed files with 5851 additions and 75 deletions

View file

@ -0,0 +1,33 @@
package repo
import (
"os/exec"
"path/filepath"
"strings"
)
// GetRootDirPath will return this repo full dir path
func GetRootDirPath() string {
cmd := exec.Command("git", "rev-parse", "--show-toplevel")
byteArr, err := cmd.Output()
if err != nil {
panic(err)
}
return strings.TrimSpace(string(byteArr))
}
// GetTestsDirPath will return tests folder full path
func GetTestsDirPath() string {
return filepath.Join(GetRootDirPath(), "tests")
}
// GetTestsFilePath will return full file path of the file in the tests folder
func GetTestsFilePath(subPath string) string {
return filepath.Join(GetTestsDirPath(), subPath)
}
// GetTestDataFilePath will return full file path of the file in the testdata folder
func GetTestDataFilePath(subPath string) string {
return filepath.Join(GetTestsDirPath(), "testdata", subPath)
}