📋
GoSQL
  • GoSQL
  • Conventions
  • Basic Usage
    • Select Queries
    • Insert
    • Update
    • Delete
  • Advanced Usage
Powered by GitBook
On this page

Was this helpful?

GoSQL

GoSQL is a fast, easy query builder for Golang.

Getting Started

Get the package:

$ go get github.com/twharmon/gosql

Open a connection to a database:

sqliteDB, _ := sql.Open("sqlite3", "my-db.sql")
db := gosql.New(sqliteDB)

Register your structs that have corresponding tables in the database:

type User struct {
    ID       int `gosql:"primary"`
    Email    string
    IsActive bool
}

db.Register(User{})

You must register all struct types before using them with GoSQL.

NextConventions

Last updated 5 years ago

Was this helpful?