Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Update transactions how to example #1775

Merged
merged 1 commit into from
Aug 7, 2022

Conversation

jasonblanchard
Copy link
Contributor

@jasonblanchard jasonblanchard commented Aug 5, 2022

The example for transactions is a little confusing for a few reasons:

  1. It mentions WithTx, but then it never actually calls it
  2. Confusing use of the db package - I believe db.Begin(ctx) should be p.Begin(ctx)

My suggestion here does a few things:


  1. Fixes the above issues.
  2. Uses naming conventions that match the “Getting started with PostgreSQL” tutorial (i.e package tutorial, queries, schema.sql, query.sql, db, etc).
  3. Use database/sql and lib/pq to match the “Getting started with PostgreSQL” tutorial.

Copy link
Collaborator

@kyleconroy kyleconroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the improvements!

@kyleconroy kyleconroy merged commit a2a6f16 into sqlc-dev:main Aug 7, 2022
jlisthood pushed a commit to jlisthood/sqlc that referenced this pull request Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants