Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
gorp
✓ github.com/go-gorp/gorp
Map a struct to a SQLite table
package main
import (
"database/sql"
"fmt"
_ "github.com/mattn/go-sqlite3"
"github.com/go-gorp/gorp"
)
func main() {
db, _ := sql.Open("sqlite3", ":memory:")
dbmap := &gorp.DbMap{Db: db, Dialect: gorp.SqliteDialect{}}
t := dbmap.AddTableWithName(MyStruct{}, "mytable").SetKeys(true, "Id")
fmt.Println(t)
}
type MyStruct struct {
Id int64
Name string
}
Upgrade
Version history
2.2.0+incompatiblelatest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.