SQLx vs SQLc

  Рет қаралды 27,533

TheVimeagen

TheVimeagen

4 ай бұрын

LIVE ON TWITCH: / theprimeagen
Become a backend engineer. Its my favorite site
boot.dev/?promo=PRIMEYT
This is also the best way to support me is to support yourself becoming a better backend engineer.
Get in on Discord: / discord
Get in on Twitter: / theprimeagen
Got Something For Me to Read or Watch??:
/ theprimeagenreact

Пікірлер: 44
@QuentinDurot
@QuentinDurot 4 ай бұрын
20 minutes of missing the point of SQLC ^^ gold
@nooraldeen6637
@nooraldeen6637 3 ай бұрын
elaborate?
@edgardevelops
@edgardevelops 2 ай бұрын
@@nooraldeen6637 sqlc is sql compiler, he only get it after 20 minutes
@jeffreysmith9837
@jeffreysmith9837 Ай бұрын
​@@nooraldeen6637sqlc generates all that code. It's a codegen tool
@betoharres
@betoharres Ай бұрын
tbf I also took that long as well
@UnFiltered1776
@UnFiltered1776 4 ай бұрын
HookerSQL has a certain ring to it.
@user-kh5lm5ce7g
@user-kh5lm5ce7g 2 ай бұрын
SQLC + goose (or any other migration tool you like) is really pure joy. One of the most beautiful go packages built so far
@dimo3611
@dimo3611 4 ай бұрын
I used SQLC with postgres and pg-builtin Json-functions to allow batch-upserts whilst returning all entries with its updated (upserted) values. Being able to build these queries and simply using some methods exposed on the queries-struct made my life way easier. Note for Joins: AFAIK - sqlc clever, it will generate output structs if not mapped to the table-definitions. So, they work. Other notes: You can swap out the underlaying sql-driver interface to profit of e.g. (no)cgo, using specialized sql-driver based on db-type, pooling. Also: sql.Null can be replaced by pointer via config. also: sqlx code gotta be written by you. for sqlc, you simply call the generated methods. this aint a useful comparison imo. EDIT: He realized kekw
@lguedes768
@lguedes768 4 ай бұрын
That lcravo is a legend bro
@jonathanjacobson7012
@jonathanjacobson7012 4 ай бұрын
SQLc reminds me of the PL/1 SQL preprocessor
@azrafal
@azrafal 3 ай бұрын
i have watched the entire video twice
@stonehat
@stonehat 4 ай бұрын
How will Turso handle working offline and syncing later?
@paxcoder
@paxcoder 4 ай бұрын
I heard Ptagen talk about sqlc, so I googled sqlx vs sqlc, and got this video []-[]
@kevinkkirimii
@kevinkkirimii 4 ай бұрын
I'd use sqlx for the struct tags and batch inserts when required and sqlc for the code gen to ramp up initial development otherwise I'd just use the low level standard library.
@mo-nf4cr
@mo-nf4cr 4 ай бұрын
Yeah for me its more like sqlc for static queries, then reuse sqlc types with sqlx for dynamic queries
@pss_crs
@pss_crs Ай бұрын
create your own types and embed the Sqlc generated one the call your interface, I don't understand what you mean low level but sqlc can generate pure idiomatic code without 3rd party dependency just standard libraries
@trebabcock
@trebabcock 3 ай бұрын
You should start using the `if err := function(); err != nil {}` syntax on functions that only return an error. Maybe you already do, this is weeks ago and I'm only 15 minutes in.
@JohnDoe-ji1zv
@JohnDoe-ji1zv Ай бұрын
How does it work with postgis ? Custom types etc ?
@pss_crs
@pss_crs Ай бұрын
it took you 20 minutes to understand SQLC, what ever library you use you would write SQL queries even if it's ORM so just generate it more idiomatic Go API's and then use it
@linearz
@linearz 4 ай бұрын
sqlx enjoyer here, less cognitive load.
@hansmaulwurf8027
@hansmaulwurf8027 4 ай бұрын
Software is not finished, it gets released. Slightly altered quote from wren Weichmann.
@UnFiltered1776
@UnFiltered1776 4 ай бұрын
Super duper is the way to be.
@DennisJHarrisonJrHere
@DennisJHarrisonJrHere 4 ай бұрын
I use sqlc in my dayjob. The type safety and compiler checking on both sides is good. I miss eloquent :)
@azrafal
@azrafal 4 ай бұрын
how do you handle migration?
@mayormccheese8673
@mayormccheese8673 4 ай бұрын
@@azrafalgolang-migrate
@JohnDoe-ji1zv
@JohnDoe-ji1zv Ай бұрын
Do you use any custom types or postgis ? Do you think sqlc is able to handle that ?
@mayormccheese8673
@mayormccheese8673 Ай бұрын
@@JohnDoe-ji1zv I use Postgres and pgx/v5 with custom composite types. It works great.
@poderosoexcalibur-yp3kl
@poderosoexcalibur-yp3kl Ай бұрын
@@azrafalatlas works pretty nice
@spartan_j117
@spartan_j117 4 ай бұрын
What's the point of those sqlc(x) if you still write raw sql? It's ok for very basic queries, agree. But what about a complex ones? I would suggest to have a look into "go-jet". It's a gamechanger, imo.
@stefankyriacou7151
@stefankyriacou7151 4 ай бұрын
just googled go-jet, and this is exactly what I was looking for, thank you!
@39strife
@39strife 17 күн бұрын
jet hasn't been updated in months
@Im_Ninooo
@Im_Ninooo 4 ай бұрын
52:30 nooooo!! don't use Make, use Taskfile!!
@DavidFregoli
@DavidFregoli 4 ай бұрын
thanks it looks good
@Gigasharik5
@Gigasharik5 3 күн бұрын
pgx.
@guillemgarcia3630
@guillemgarcia3630 4 ай бұрын
Oh man, I just realized. I can get chatgpt to generate many useful sql queries for each table in a schema. So that gpt generates the queries, and sqlc generates the go code from those queries. Someone should make a cli utility from that. Saas idea cmon
@dandogamer
@dandogamer 4 ай бұрын
Theres a nice library called sqlc-grpc which can even generate grpc/http api
@miracleinnocent2649
@miracleinnocent2649 4 ай бұрын
fun fact sqlx rust actually copied go's sqlx
@mrmaniac9905
@mrmaniac9905 4 ай бұрын
This is the reinventing the wheel that is unneeded, prime
@thiccbonkus
@thiccbonkus 4 ай бұрын
blue
@haywooddunnett4190
@haywooddunnett4190 3 ай бұрын
Promo-SM
@sirbuttonhd
@sirbuttonhd 4 ай бұрын
first... finally
@FredyHD
@FredyHD 4 ай бұрын
Noice
@josesimoes3478
@josesimoes3478 4 ай бұрын
One day I will do it too!!
Learning Golang Context!! Never Looked At It!
25:03
TheVimeagen
Рет қаралды 31 М.
The Only Database Abstraction You Need | Prime Reacts
21:42
ThePrimeTime
Рет қаралды 191 М.
Мы никогда не были так напуганы!
00:15
Аришнев
Рет қаралды 2,9 МЛН
Khóa ly biệt
01:00
Đào Nguyễn Ánh - Hữu Hưng
Рет қаралды 20 МЛН
Stupid Barry Find Mellstroy in Escape From Prison Challenge
00:29
Garri Creative
Рет қаралды 21 МЛН
버블티로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 70 МЛН
New Gleam Just Dropped
25:33
ThePrimeTime
Рет қаралды 74 М.
Go 1.22 Released!
40:07
ThePrimeTime
Рет қаралды 91 М.
Go application setup with PostgreSQL, sqlx, goose migrations
9:38
Make Programming Fun Again
Рет қаралды 2,4 М.
I Learned Haskell In 15 Years
36:03
ThePrimeTime
Рет қаралды 83 М.
"The Life & Death of htmx" by Alexander Petros at Big Sky Dev Con 2024
23:01
Montana Programmers
Рет қаралды 21 М.
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 332 М.
The BEST Tool to Structure Golang Projects
7:58
Melkey
Рет қаралды 18 М.
Golang Building SSH and Bubble Tea App
57:08
TheVimeagen
Рет қаралды 62 М.
Projects Every Programmer Should Try
16:58
ThePrimeTime
Рет қаралды 383 М.
Go SQL Comparison (squirrel, raw queries, sqlc and sqlx)
35:06
Web Dev Fuel
Рет қаралды 4,7 М.
Gizli Apple Watch Özelliği😱
0:14
Safak Novruz
Рет қаралды 3,9 МЛН
Неразрушаемый смартфон
1:00
Status
Рет қаралды 1,8 МЛН
WWDC 2024 Recap: Is Apple Intelligence Legit?
18:23
Marques Brownlee
Рет қаралды 6 МЛН
iOS 18 vs Samsung, Xiaomi,Tecno, Android
0:54
AndroHack
Рет қаралды 90 М.
Телефон в воде 🤯
0:28
FATA MORGANA
Рет қаралды 1,2 МЛН