Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/howto/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ When selecting multiple columns, a row record (method-specific struct) is
returned. In this case, `GetInfoForAuthor` returns a struct with two fields:
`Bio` and `BirthYear`.

If a query result has no row records, a zero value and an `ErrNoRows` error are
returned instead of a zero value and `nil`. For instance, when the `GetBioForAuthor`
result has no rows, it will return `""` and `ErrNoRows`.

```go
package db

Expand Down
2 changes: 1 addition & 1 deletion internal/tools/sqlc-pg-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func clean(arg string) string {
return arg
}

// writeFormattedGo executes `tmpl` with `data` as its context to the the file `destPath`
// writeFormattedGo executes `tmpl` with `data` as its context to the file `destPath`
func writeFormattedGo(tmpl *template.Template, data any, destPath string) error {
out := bytes.NewBuffer([]byte{})
err := tmpl.Execute(out, data)
Expand Down