Registry / database / go-gorp-gorp

go-gorp-gorp

JSON →
library2.2.0+incompatiblegogounverified

Provides a simple way to marshal Go structs to and from SQL databases.

go get github.com/go-gorp/gorp
INSTALL
IMPORT
SIG · GO-GORP-GORP
G
go-gorp-gorp
databasegov2.2.0+incompatible
harness data pending
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 }
Debug
Known issues
breakingVersion 2.2.0+incompatible indicates breaking changes from v1; ensure compatibility with existing code
fix
Use v2 import path and update API calls accordingly
affects: >=2.0.0
Upgrade
Version history
2.2.0+incompatiblelatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
24
Resources
go-gorp-gorp — go get go-gorp-gorp · libregistry