Registry / orm / go-gorp-gorp-v3

go-gorp-gorp-v3

JSON →
library3.1.0gogounverified

Package gorp provides a simple way to marshal Go structs to and from SQL databases.

go get github.com/go-gorp/gorp/v3
INSTALL
IMPORT
SIG · GO-GORP-GORP-V3
G
go-gorp-gorp-v3
ormgov3.1.0
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/v3

Creates a table and inserts a record using Gorp.

package main import ( "database/sql" "fmt" "github.com/go-gorp/gorp/v3" _ "github.com/mattn/go-sqlite3" ) type Person struct { Id int `db:"id"` Name string `db:"name"` } func main() { db, _ := sql.Open("sqlite3", ":memory:") dbmap := &gorp.DbMap{Db: db, Dialect: gorp.SqliteDialect{}} dbmap.AddTableWithName(Person{}, "people").SetKeys(true, "Id") dbmap.CreateTables() err := dbmap.Insert(&Person{Name: "Alice"}) fmt.Println(err) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
3.1.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
35 hits · last 30 days
node
32
Perplexity
1
Resources
go-gorp-gorp-v3 — go get go-gorp-gorp-v3 · libregistry