MCPcopy Create free account
hub / github.com/go-pg/pg / ExampleDB_Model_selectLastRow

Function ExampleDB_Model_selectLastRow

example_model_test.go:279–289  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

277}
278
279func ExampleDB_Model_selectLastRow() {
280 db := modelDB()
281
282 var lastBook Book
283 err := db.Model(&lastBook).Last()
284 if err != nil {
285 panic(err)
286 }
287 fmt.Println(lastBook)
288 // Output: Book<Id=3 Title="book 3">
289}
290
291func ExampleDB_Model_selectAllColumns() {
292 db := modelDB()

Callers

nothing calls this directly

Calls 3

modelDBFunction · 0.85
LastMethod · 0.80
ModelMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…