home.social

#sqlc — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #sqlc, aggregated by home.social.

  1. This is pretty sweet. , a library for which lets you write your queries directly in SQL. Think , but for lua. 😎

    git.sr.ht/~technomancy/litehug

  2. 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:
    laelapa.dev/blog/001-the-three

    ---

    Replies to this thread show up in the article's comment section.

  3. 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) 💀

  4. Меньше кода, больше результата: применяем sqlc для работы с БД

    Привет, Хабр! Инструмент, который генерирует производительный и безопасный код для работы с базой данных — миф или реальность? В этой статье обсудим, что такое sqlc, откуда он появился и какие идеи в него заложены. Разберём его возможности и ограничения, а также кейсы, когда он подходит лучше всего.

    habr.com/ru/companies/uzum/art

    #go #sqlc #golang #postgresql #uzum #uzumtech

  5. 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? ;)

    #SQL #PostgreSQL #Postgres #SQLC #Go #GoLang

  6. I am generating db use with , api with , and page renders with .

    The last thing I'm actually writing is my test with . Which dictate how everything else is built.

    Feels like my workflow has gotten pretty productive. Once I stopped trying to bikeshed. 😅

  7. I started to play a little with . Think code generator for queries you write in .

    You still need to do migrations. But certainly makes the whole "service is the data" considerably more apparent. 😎

    sqlc.dev/

  8. I've been playing with #sqlc for database access (in this case #sqlite) in #Go. It does a great job with static queries but falls down hard on dynamic queries. Really needs to be a better answer there. I love the idea, but dynamic queries need a solution.

  9. @sybren I’m using goose as my migration tool, embeds all migrations and auto migrates during startup.

    in turn reads each migration and generates models.

    github.com/pressly/goose

  10. 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.

    From brandur.org/sqlc

    #golang #orm #sqlc

  11. 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: preslav.me/2023/03/07/reasons-

    #prgramming #golang #sql