https://github.com/gjbae1212/go-sql
This project is a db connector for SQL databases. And so support to trace context like opentracing.
https://github.com/gjbae1212/go-sql
database go golang mysql sql
Last synced: 11 months ago
JSON representation
This project is a db connector for SQL databases. And so support to trace context like opentracing.
- Host: GitHub
- URL: https://github.com/gjbae1212/go-sql
- Owner: gjbae1212
- License: mit
- Created: 2020-01-17T05:01:32.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-30T10:33:57.000Z (about 6 years ago)
- Last Synced: 2025-02-17T05:25:31.028Z (about 1 year ago)
- Topics: database, go, golang, mysql, sql
- Language: Go
- Homepage:
- Size: 26.4 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-sql
This project is a db connector for SQL databases. And so support to trace context like opentracing.
In this time, mysql is to support only. Continuously expect to support databases like Sqlite, BigQuery, and so on.
## Getting Started
### Mysql
```go
package main
import (
gomysql "github.com/gjbae1212/go-sql/mysql"
)
func main() {
// conn, err := gomysql.NewConnectorWithOpentracing("user:password@/dbname", 2)
conn, err := gomysql.NewConnector("user:password@/dbname", 2)
if err != nil {
panic(err)
}
if err := conn.Connect(); err != nil {
panic(err)
}
db, err := conn.DB()
if err != nil {
panic(err)
}
}
```
## To be Supported
- [ ] Sqlite
- [ ] Postgres
- [ ] BigQuery
- [ ] And so on ...
## License
This project is licensed under the MIT License