In this video, you'll learn the pros and cons of 4 different ways to interact with an SQL database in Go, by comparing squirrel vs raw queries vs sqlc vs sqlx.
sqlc is my favorite, because has the highest performance (my benchmarks). I use it with a million users in mysql and postgres. You also have more control over your queries since you write them by hand. Good video!!! Thank you.
Thank you for sharing your experience! I've actually been using sqlx or the std library more, since I've found I had to modify the sqlc code for some edge cases. But if it works for you, that's what's important!! 😊
I don't think I have the code snippets publicly available, but I'll try to find them and update the description with the link to the repo! Thank you for watching! 🙏
If you build the query manually, yes. I said in the video that it's a possibility, but not if you build the query in the correct way (e.g. with question marks and the values as arguments).
Thank you for sharing this. I can only imagine the analysis that went into sorting the pros and cons. Thank you again for speeding out thinking cycle up 🫡
Awesome explanation and amazing seeing examples for each library. Thank you.
Thank you, I appreciate you watching. Glad it was helpful to you! 🙏
sqlc is my favorite, because has the highest performance (my benchmarks). I use it with a million users in mysql and postgres. You also have more control over your queries since you write them by hand. Good video!!! Thank you.
Does it work well with N+1 queries? (for two or more structs)
Thank you for sharing your experience! I've actually been using sqlx or the std library more, since I've found I had to modify the sqlc code for some edge cases. But if it works for you, that's what's important!! 😊
Thanks! That was very insightful.
Thank you very much! I'm really glad it was insightful to you! 🙏
Great video.
Glad you enjoyed it!
thanks!
I'm glad it was helpful! Thanks for watching!
Very nice explanation, Can you please provide all the code snippets examples you have used.
I don't think I have the code snippets publicly available, but I'll try to find them and update the description with the link to the repo! Thank you for watching! 🙏
What application is that, that you using for the notes?
Google excalidraw 👌🏿
It's excalidraw.
sqlx it is. sql proficiency , control and gigachad points.
I agree, sqlx is probably my favorite choice too!
sql injections using sqlx? lol not true
If you build the query manually, yes. I said in the video that it's a possibility, but not if you build the query in the correct way (e.g. with question marks and the values as arguments).
The language is called Go, not Golang.
Sure, but it's referred to as Golang all the time so it's fine either way.
Thank you for sharing this. I can only imagine the analysis that went into sorting the pros and cons. Thank you again for speeding out thinking cycle up 🫡
Glad it was helpful!