diff --git a/docs/howto/insert.md b/docs/howto/insert.md index e78dc7f2ab..85fa748916 100644 --- a/docs/howto/insert.md +++ b/docs/howto/insert.md @@ -154,11 +154,11 @@ INSERT INTO authors (name, bio) VALUES ($1, $2); ```go type CreateAuthorsParams struct { - Name string - Bio string + Name string + Bio string } func (q *Queries) CreateAuthors(ctx context.Context, arg []CreateAuthorsParams) (int64, error) { - return q.db.CopyFrom(ctx, []string{"authors"}, []string{"name", "bio"}, &iteratorForCreateAuthors{rows: arg}) + return q.db.CopyFrom(ctx, []string{"authors"}, []string{"name", "bio"}, &iteratorForCreateAuthors{rows: arg}) } ``` diff --git a/docs/howto/transactions.md b/docs/howto/transactions.md index 0ccacb9000..ce822b07b4 100644 --- a/docs/howto/transactions.md +++ b/docs/howto/transactions.md @@ -58,7 +58,7 @@ func (q *Queries) GetRecord(ctx context.Context, id int) (Record, error) { With pgx you'd use it like this for example: ```go -function bumpCounter(ctx context.Context, p *pgx.Conn, id int) error { +func bumpCounter(ctx context.Context, p *pgx.Conn, id int) error { tx, err := db.Begin(ctx) if err != nil { return err @@ -71,7 +71,7 @@ function bumpCounter(ctx context.Context, p *pgx.Conn, id int) error { } if err := q.UpdateRecord(ctx, db.UpdateRecordParams{ ID: r.ID, - Counter: r.Counter+1, + Counter: r.Counter + 1, }); err != nil { return err } diff --git a/docs/reference/query-annotations.md b/docs/reference/query-annotations.md index 024737594d..fe9fa791f5 100644 --- a/docs/reference/query-annotations.md +++ b/docs/reference/query-annotations.md @@ -130,9 +130,10 @@ WHERE book_id = $1; ```go type DeleteBookBatchResults struct { - br pgx.BatchResults + br pgx.BatchResults ind int } + func (q *Queries) DeleteBook(ctx context.Context, bookID []int32) *DeleteBookBatchResults { //... } @@ -161,13 +162,14 @@ WHERE title = $1 AND year = $2; ```go type BooksByTitleYearBatchResults struct { - br pgx.BatchResults + br pgx.BatchResults ind int } type BooksByTitleYearParams struct { Title string `json:"title"` Year int32 `json:"year"` } + func (q *Queries) BooksByTitleYear(ctx context.Context, arg []BooksByTitleYearParams) *BooksByTitleYearBatchResults { //... } @@ -202,13 +204,14 @@ RETURNING book_id, author_id, isbn ```go type CreateBookBatchResults struct { - br pgx.BatchResults + br pgx.BatchResults ind int } type CreateBookParams struct { - AuthorID int32 `json:"author_id"` - Isbn string `json:"isbn"` + AuthorID int32 `json:"author_id"` + Isbn string `json:"isbn"` } + func (q *Queries) CreateBook(ctx context.Context, arg []CreateBookParams) *CreateBookBatchResults { //... }