WIP: Insert sets PK
This commit is contained in:
+9
-9
@@ -61,7 +61,7 @@ func TestInsertAndSelectSingle(t *testing.T) {
|
||||
|
||||
testObj := Test{Int64Field: 54, IntField: 12, StringField: "asdf"}
|
||||
|
||||
insertExec, err := exec.NewInsert(orm, &testObj)
|
||||
insertExec, err := exec.NewInsert[Test](orm, testObj)
|
||||
if err != nil {
|
||||
log.LogError("TestInsertAndSelectSingle setup failed: %s", err)
|
||||
t.Fail()
|
||||
@@ -118,7 +118,7 @@ func TestInsertSelectWithCompositePk(t *testing.T) {
|
||||
|
||||
testObj := TestWithCompositePk{ID: 12, Name: "Test"}
|
||||
|
||||
insertExec, err := exec.NewInsert(orm, &testObj)
|
||||
insertExec, err := exec.NewInsert[TestWithCompositePk](orm, testObj)
|
||||
if err != nil {
|
||||
log.LogError("TestInsertSelectWithCompositePk setup failed: %s", err)
|
||||
t.Fail()
|
||||
@@ -176,14 +176,14 @@ func TestInsertMultipleAndSelectWithParam(t *testing.T) {
|
||||
testObj := Test{Int64Field: 54, IntField: 12, StringField: "asdf"}
|
||||
testObjSecond := Test{Int64Field: 12, IntField: 54, StringField: "fdsa"}
|
||||
|
||||
insertExec, err := exec.NewInsert(orm, &testObj)
|
||||
insertExec, err := exec.NewInsert[Test](orm, testObj)
|
||||
if err != nil {
|
||||
log.LogError("TestInsertMultipleAndSelectWithParam setup failed: %s", err)
|
||||
t.Fail()
|
||||
return
|
||||
}
|
||||
|
||||
insertSecond, err := exec.NewInsert(orm, &testObjSecond)
|
||||
insertSecond, err := exec.NewInsert[Test](orm, testObjSecond)
|
||||
if err != nil {
|
||||
log.LogError("TestInsertMultipleAndSelectWithParam setup failed: %s", err)
|
||||
t.Fail()
|
||||
@@ -247,7 +247,7 @@ func TestInsertAndUpdate(t *testing.T) {
|
||||
|
||||
testObj := Test{Int64Field: 54, IntField: 12, StringField: "asdf"}
|
||||
|
||||
insertExec, err := exec.NewInsert(orm, &testObj)
|
||||
insertExec, err := exec.NewInsert[Test](orm, testObj)
|
||||
if err != nil {
|
||||
log.LogError("TestInsertAndUpdate setup failed: %s", err)
|
||||
t.Fail()
|
||||
@@ -333,7 +333,7 @@ func TestInsertAndDelete(t *testing.T) {
|
||||
|
||||
testObj := Test{Int64Field: 54, IntField: 12, StringField: "asdf"}
|
||||
|
||||
insertExec, err := exec.NewInsert(orm, &testObj)
|
||||
insertExec, err := exec.NewInsert[Test](orm, testObj)
|
||||
if err != nil {
|
||||
log.LogError("TestInsertAndDelete setup failed: %s", err)
|
||||
t.Fail()
|
||||
@@ -363,7 +363,7 @@ func TestInsertAndDelete(t *testing.T) {
|
||||
return
|
||||
}
|
||||
|
||||
deleteExec, err := exec.NewDelete(orm, selectRes)
|
||||
deleteExec, err := exec.NewDelete[Test](orm, selectRes...)
|
||||
|
||||
// WHEN
|
||||
err = deleteExec.Execute(conn)
|
||||
@@ -396,7 +396,7 @@ func TestBoolInsertAndSelectSingle(t *testing.T) {
|
||||
|
||||
testObj := TestWithBool{BoolField: true}
|
||||
|
||||
insertExec, err := exec.NewInsert(orm, &testObj)
|
||||
insertExec, err := exec.NewInsert[TestWithBool](orm, testObj)
|
||||
if err != nil {
|
||||
log.LogError("TestBoolInsertAndSelectSingle setup failed: %s", err)
|
||||
t.Fail()
|
||||
@@ -452,7 +452,7 @@ func TestTimeInsertAndSelectSingle(t *testing.T) {
|
||||
now := time.Now().UnixMilli()
|
||||
testObj := TestWithTime{TimeField: now}
|
||||
|
||||
insertExec, err := exec.NewInsert(orm, &testObj)
|
||||
insertExec, err := exec.NewInsert[TestWithTime](orm, testObj)
|
||||
if err != nil {
|
||||
log.LogError("TestTimeInsertAndSelectSingle setup failed: %s", err)
|
||||
t.Fail()
|
||||
|
||||
Reference in New Issue
Block a user