This commit is contained in:
+30
-1
@@ -4,11 +4,40 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
log "gitlab.com/gdulai/simpleloglvl"
|
||||
)
|
||||
|
||||
type Test struct {
|
||||
ID int `sql:"pk"`
|
||||
Int64Field int64 `sql:"nn"`
|
||||
IntField int `sql:"nn"`
|
||||
StringField string `sql:"nn"`
|
||||
}
|
||||
|
||||
type TestWithFk struct {
|
||||
ID int `sql:"pk"`
|
||||
TestID int `sql:"nn;fk=Test.ID"`
|
||||
}
|
||||
|
||||
type TestWithFkAndFkId struct {
|
||||
ID int `sql:"pk"`
|
||||
TestID int `sql:"nn;fk=Test.ID;fk_id=custom_fk"`
|
||||
}
|
||||
|
||||
type TestWithCompositePk struct {
|
||||
ID int `sql:"nn;pk"`
|
||||
Name string `sql:"nn;pk"`
|
||||
}
|
||||
|
||||
type TestWithCompositeFk struct {
|
||||
ID int `sql:"nn;pk"`
|
||||
CompositeFkId int `sql:"nn;fk=TestWithCompositePk.ID;"`
|
||||
CompositeFkName string `sql:"nn;fk=TestWithCompositePk.Name;"`
|
||||
}
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
log.SetupLogs("Debug")
|
||||
log.SetupLogs("Info")
|
||||
|
||||
code := m.Run()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user