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

Update DB Readme #602

Merged
merged 2 commits into from
May 26, 2022
Merged

Update DB Readme #602

merged 2 commits into from
May 26, 2022

Conversation

rdp
Copy link
Contributor

@rdp rdp commented Apr 6, 2022

Add example of query parameters in a query, mention there are more helper methods available for query, mention preparedstatements are at play (crystal-lang/crystal-db#164).

Add example of query parameters in a query, mention there are more helper methods available for query, mention preparedstatements are at play crystal-db/crystal-lang#164
@netlify
Copy link

netlify bot commented Apr 6, 2022

Deploy Preview for crystal-book ready!

Name Link
🔨 Latest commit a147195
🔍 Latest deploy log https://app.netlify.com/sites/crystal-book/deploys/624f85432ec96c0008607df5
😎 Deploy Preview https://deploy-preview-602--crystal-book.netlify.app/database
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@rdp
Copy link
Contributor Author

rdp commented Apr 6, 2022

Note to self: after this is committed add an example of creating a PreparedStatement...

Comment on lines 79 to 80
Query parameters are accomplished typically using PreparedStatements under the hood,
though this can be disabled via a connection string option `prepared_statements=false`.
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if that statement is correct. I don't think query parameters are technically tied to prepared statements.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also in a147195

@@ -91,6 +93,16 @@ db.query "select name, age from contacts order by age desc" do |rs|
end
```

You can also use query parameters:
Copy link
Member

Choose a reason for hiding this comment

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

Query parameters are already mentioned in more depth a couple lines above. It would probably make sense to move the explanation of query parameters to a separate section and reference that from both exec and query sections.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK attempted see a147195

@beta-ziliani beta-ziliani merged commit c4294ae into crystal-lang:master May 26, 2022
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.

4 participants