MCPcopy
hub / github.com/GoesToEleven/golang-web-dev / read

Function read

032_rdbms/02_SQL/main.go:88–99  ·  view source on GitHub ↗
(w http.ResponseWriter, req *http.Request)

Source from the content-addressed store, hash-verified

86}
87
88func read(w http.ResponseWriter, req *http.Request) {
89 rows, err := db.Query(`SELECT * FROM customer;`)
90 check(err)
91 defer rows.Close()
92
93 var name string
94 for rows.Next() {
95 err = rows.Scan(&name)
96 check(err)
97 fmt.Fprintln(w, "RETRIEVED RECORD:", name)
98 }
99}
100
101func update(w http.ResponseWriter, req *http.Request) {
102 stmt, err := db.Prepare(`UPDATE customer SET name="Jimmy" WHERE name="James";`)

Callers

nothing calls this directly

Calls 1

checkFunction · 0.70

Tested by

no test coverage detected