#sqlc — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #sqlc, aggregated by home.social.
-
When building CRUD apps with capability for partial updates in #Go & #PostgreSQL with #sqlc , how do you tell the difference between "field omitted" and "field was set explicitly to zero-value"?
Go pointers solve that issue but carrying it all the way to the database requires bridging three type systems.
I explored reflection, generics, and code generation as possible solutions.
Here's the write-up:
https://laelapa.dev/blog/001-the-three-value-problem--a-journey-from-json-to-go-pointers-to-postgres-native-types---
Replies to this thread show up in the article's comment section.
-
En ce début de vacances, mes parents m'ont demandé de faire une application qui les notifierait lorsqu'il faisait trop chaud dans la serre et qu'il fallait l'ouvrir (mon petit frère électronicien a déjà fait le capteur)
Je me suis dit que ce serait l'occasion d'apprendre le #golang et d'autres technologies ( #templ #sqlc #alpineJS etc... )
Maintenant je termine gentiment le backend, et la partie la plus dure m'attend: faire un appli Android (j'ai pas hâte) 💀 -
Меньше кода, больше результата: применяем sqlc для работы с БД
Привет, Хабр! Инструмент, который генерирует производительный и безопасный код для работы с базой данных — миф или реальность? В этой статье обсудим, что такое sqlc, откуда он появился и какие идеи в него заложены. Разберём его возможности и ограничения, а также кейсы, когда он подходит лучше всего.
-
Here's an sqlc + postgres query, used to fetch a list of posts to be displayed on a user's profile:
-- name: GetPostsByAuthor :many
SELECT * FROM posts WHERE author = $1;Can you spot the problem with this query? ;)
-
This is simply brilliant!
> ORMs also have the problem of being an impedance mismatch compared to the raw SQL most people are used to, meaning you’ve got the reference documentation open all day looking up how to do accomplish things when the equivalent SQL would’ve been automatic.
-
I'm turning into a #sqlc fan boy. Type safe queries in #go just feel right.
https://adriano.fyi/posts/2024-03-07-upsert-uuids-with-sqlc/
-
I wanted to share a couple of points of why I am not a particular fan of #sqlc, but as usually, those turned into a full-blown blog post: https://preslav.me/2023/03/07/reasons-against-sqlc/