Skip to content

Commit

Permalink
Update xsql go_ora
Browse files Browse the repository at this point in the history
  • Loading branch information
onanying committed Jun 7, 2024
1 parent 94af46f commit 7589410
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/xsql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Of course, you can also map usage like `gorm`, `xorm`.
type Test struct {
Id int `xsql:"id"`
Foo string `xsql:"foo"`
Bar time.Time `xsql:"bar"` // oracle uses goora.TimeStamp
Bar time.Time `xsql:"bar"` // oracle uses go_ora.TimeStamp
}

func (t Test) TableName() string {
Expand Down
20 changes: 10 additions & 10 deletions src/xsql/dbora_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"database/sql"
"fmt"
"github.com/mix-go/xsql"
ora "github.com/sijms/go-ora/v2"
"github.com/sijms/go-ora/v2"
"github.com/stretchr/testify/assert"
"log"
"testing"
Expand Down Expand Up @@ -52,9 +52,9 @@ func TestOracleQuery(t *testing.T) {
}

type TestOracle struct {
Id int `xsql:"ID"`
Foo string `xsql:"FOO"`
Bar ora.TimeStamp `xsql:"BAR"`
Id int `xsql:"ID"`
Foo string `xsql:"FOO"`
Bar go_ora.TimeStamp `xsql:"BAR"`
}

func (t TestOracle) TableName() string {
Expand All @@ -69,7 +69,7 @@ func TestOracleInsert(t *testing.T) {
test := TestOracle{
Id: 3,
Foo: "test",
Bar: ora.TimeStamp(time.Now()),
Bar: go_ora.TimeStamp(time.Now()),
}
_, err := DB.Insert(&test)

Expand All @@ -86,12 +86,12 @@ func __TestOracleBatchInsert(t *testing.T) {
{
Id: 4,
Foo: "test1",
Bar: ora.TimeStamp(time.Now()),
Bar: go_ora.TimeStamp(time.Now()),
},
{
Id: 5,
Foo: "test2",
Bar: ora.TimeStamp(time.Now()),
Bar: go_ora.TimeStamp(time.Now()),
},
}
_, err := DB.BatchInsert(&tests)
Expand All @@ -107,7 +107,7 @@ func TestOracleUpdate(t *testing.T) {
test := TestOracle{
Id: 999,
Foo: "test update",
Bar: ora.TimeStamp(time.Now()),
Bar: go_ora.TimeStamp(time.Now()),
}
_, err := DB.Update(&test, "id = :id", 3)

Expand Down Expand Up @@ -190,7 +190,7 @@ func TestOracleTxCommit(t *testing.T) {
test := TestOracle{
Id: 998, // oracle not support AUTO_INCREMENT
Foo: "test",
Bar: ora.TimeStamp(time.Now()),
Bar: go_ora.TimeStamp(time.Now()),
}
_, err := tx.Insert(&test)
a.Empty(err)
Expand All @@ -209,7 +209,7 @@ func TestOracleTxRollback(t *testing.T) {
test := TestOracle{
Id: 999, // oracle not support AUTO_INCREMENT
Foo: "test",
Bar: ora.TimeStamp(time.Now()),
Bar: go_ora.TimeStamp(time.Now()),
}
_, err := tx.Insert(&test)
a.Empty(err)
Expand Down

0 comments on commit 7589410

Please sign in to comment.