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

Function ExampleDB_Model_selectAllColumns

example_model_test.go:291–301  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

289}
290
291func ExampleDB_Model_selectAllColumns() {
292 db := modelDB()
293
294 var book Book
295 err := db.Model(&book).Column("book.*").First()
296 if err != nil {
297 panic(err)
298 }
299 fmt.Println(book, book.AuthorID)
300 // Output: Book<Id=1 Title="book 1"> 1
301}
302
303func ExampleDB_Model_selectSomeColumns() {
304 db := modelDB()

Callers

nothing calls this directly

Calls 4

modelDBFunction · 0.85
FirstMethod · 0.80
ColumnMethod · 0.80
ModelMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…