GoSQL
GoSQL is a fast, easy query builder for Golang.

Getting Started

Get the package:
1
$ go get github.com/twharmon/gosql
Copied!
Open a connection to a database:
1
sqliteDB, _ := sql.Open("sqlite3", "my-db.sql")
2
db := gosql.New(sqliteDB)
Copied!
Register your structs that have corresponding tables in the database:
1
type User struct {
2
ID int `gosql:"primary"`
3
Email string
4
IsActive bool
5
}
6
​
7
db.Register(User{})
Copied!
You must register all struct types before using them with GoSQL.
Last modified 2yr ago
Copy link