Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sankooc/gibero
tibero driver for go
https://github.com/sankooc/gibero
Last synced: 26 days ago
JSON representation
tibero driver for go
- Host: GitHub
- URL: https://github.com/sankooc/gibero
- Owner: sankooc
- License: apache-2.0
- Created: 2023-07-25T03:24:05.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-07-26T04:01:45.000Z (over 1 year ago)
- Last Synced: 2023-09-05T03:14:10.573Z (over 1 year ago)
- Language: Go
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# Gibero (WIP)
Tibero-Driver for Go's database/sql package
## install
`go get -u github.com/sankooc/gibero`
## usage
```golang
package mainimport (
"database/sql"
_ "github.com/sankooc/gibero"
)func main() {
db, _ := sql.Open("tibero", "tibero://username:[email protected]:1521/dbname")
// transaction
tx, _ := db.Begin()
db.Exec("insert into TEST_TABLE(NUM,VAR_B) values ( ?, ? )", .21, "SANKOOC-")
tx.Commit()
// query
resultSet, _ := db.Query("SELECT ID, ACCOUNT FROM TEST_DB")
for resultSet.Next() {
var id int64
var account string
// support string,int64,float64,time.Time
resultSet.Scan(&id, &account)
log.Printf("id %d %s \n", id, account)
}
}```