v0.0.358
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m22s
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m22s
This commit is contained in:
@@ -3,8 +3,8 @@ package sq
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/glebarez/go-sqlite"
|
||||
"github.com/jmoiron/sqlx"
|
||||
"github.com/mattn/go-sqlite3"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/rfctime"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/tst"
|
||||
@@ -20,18 +20,18 @@ func TestTypeConverter1(t *testing.T) {
|
||||
Timestamp time.Time `db:"timestamp"`
|
||||
}
|
||||
|
||||
sqlite.RegisterAsSQLITE3()
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
dbdir := t.TempDir()
|
||||
dbfile1 := filepath.Join(dbdir, langext.MustHexUUID()+".sqlite3")
|
||||
|
||||
sqlite3.Version() // ensure loaded
|
||||
|
||||
tst.AssertNoErr(t, os.MkdirAll(dbdir, os.ModePerm))
|
||||
|
||||
url := fmt.Sprintf("file:%s?_journal=%s&_timeout=%d&_fk=%s&_busy_timeout=%d", dbfile1, "DELETE", 1000, "true", 1000)
|
||||
url := fmt.Sprintf("file:%s?_pragma=journal_mode(%s)&_pragma=timeout(%d)&_pragma=foreign_keys(%s)&_pragma=busy_timeout(%d)", dbfile1, "DELETE", 1000, "true", 1000)
|
||||
|
||||
xdb := tst.Must(sqlx.Open("sqlite3", url))(t)
|
||||
xdb := tst.Must(sqlx.Open("sqlite", url))(t)
|
||||
|
||||
db := NewDB(xdb)
|
||||
db.RegisterDefaultConverter()
|
||||
@@ -47,23 +47,26 @@ func TestTypeConverter1(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTypeConverter2(t *testing.T) {
|
||||
|
||||
sqlite.RegisterAsSQLITE3()
|
||||
|
||||
type RequestData struct {
|
||||
ID string `db:"id"`
|
||||
Timestamp rfctime.UnixMilliTime `db:"timestamp"`
|
||||
}
|
||||
|
||||
sqlite.RegisterAsSQLITE3()
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
dbdir := t.TempDir()
|
||||
dbfile1 := filepath.Join(dbdir, langext.MustHexUUID()+".sqlite3")
|
||||
|
||||
sqlite3.Version() // ensure loaded
|
||||
|
||||
tst.AssertNoErr(t, os.MkdirAll(dbdir, os.ModePerm))
|
||||
|
||||
url := fmt.Sprintf("file:%s?_journal=%s&_timeout=%d&_fk=%s&_busy_timeout=%d", dbfile1, "DELETE", 1000, "true", 1000)
|
||||
url := fmt.Sprintf("file:%s?_pragma=journal_mode(%s)&_pragma=timeout(%d)&_pragma=foreign_keys(%s)&_pragma=busy_timeout(%d)", dbfile1, "DELETE", 1000, "true", 1000)
|
||||
|
||||
xdb := tst.Must(sqlx.Open("sqlite3", url))(t)
|
||||
xdb := tst.Must(sqlx.Open("sqlite", url))(t)
|
||||
|
||||
db := NewDB(xdb)
|
||||
db.RegisterDefaultConverter()
|
||||
|
Reference in New Issue
Block a user