sqlc-dev/sqlc
View on GitHub ↗ ★ 18,431 Go
Generate type-safe code from SQL
44 mentions on Hacker News by 35 people: 2 stories, 42 comments · first 2019-09-20 · latest 2025-04-17
20082026
-
What would you use if ORM is to be avoided? Perhaps something like https://github.com/sqlc-dev/sqlc ?
comment by anta40 · 2025-03-09 · in Goravel: A Go framework inspired by Laravel -
…appropriately to avoid CPU throttling. Good explanation here[6], and solution here[7]. [1]: https://github.com/sqlc-dev/sqlc/issues/ [2]: https://github.com/sqlc-dev/sqlc/issues/3414 [3]: https://github.com/sqlc-dev/sqlc/issues/3394 [4]:…
comment by imiric · 2024-09-29 · in Some Go web dev notes -
…like CASE WHEN @field != "" THEN column = @field ELSE true END. Example from the sqlc creator ( https://github.com/sqlc-dev/sqlc/discussions/364#discussionc... ): -- name: FilterFoo :many SELECT * FROM foo WHERE fk = @fk AND (CASE WHEN…
comment by benhoyt · 2024-09-10 · in Sqlc: Compile SQL to type-safe code -
I've been looking into sqlc lately for Go. Seems brilliant except for the lack of dynamic queries: https://github.com/sqlc-dev/sqlc/discussions/364
comment by pier25 · 2024-09-09 · in Sqlc: Compile SQL to type-safe code -
I can't find an equivalent for Go. https://github.com/sqlc-dev/sqlc and https://github.com/sqlc-dev/sqlc look nice, but they are doing codegen, definitely not as sleek as Rust sqlx. I guess it's a good example of how powerful Rust is. The…
comment by codeptualize · 2023-11-07 · in Why Golang instead of Rust to develop the Krater desktop app -
If you want to try out something cool, check out https://github.com/sqlc-dev/sqlc It's written in Go and it converts your sql migrations and queries into typesafe code that you use access your database. It currently has a plugin for Python…
comment by impulser_ · 2023-08-14 · in Python: Just Write SQL -
Some examples for anyone else reading: Go: https://github.com/kyleconroy/sqlc Rust: https://github.com/cornucopia-rs/cornucopia This is my preferred method of interacting with databases now, if available. Very flexible.
comment by w7 · 2023-06-28 · in Is ORM still an anti-pattern? -
…in looking up sqlc for python but it seems to be for go? Is there a different version than this? https://github.com/kyleconroy/sqlc
comment by jerrygenser · 2023-04-29 · in Deno 1.33: Deno 2 is coming -
…(after a redirect from github.com). There's going to be a lot of broken builds today: $ curl -i -L https://github.com/kyleconroy/sqlc/releases/download/v1.17.0/sqlc_1.17.0_linux_amd64.tar.gz HTTP/2 302 server: GitHub.com date: Fri, 24 Mar…
comment by brandur · 2023-03-24 · in GitHub's User Content certificate has expired -
Why don't you use sqlc + pgx? What's missing from the two? https://github.com/kyleconroy/sqlc https://github.com/jackc/pgx
comment by Thaxll · 2023-03-20 · in Why use Rust on the back end? -
…of course. You write your SQL queries in file, and it generates type safe bolierplate for you. https://github.com/kyleconroy/sqlc
comment by GeorgeHoneywood · 2023-01-25 · in You might not need an ORM -
Would this do? https://github.com/kyleconroy/sqlc
comment by pstuart · 2022-09-29 · in Flyweight: An ORM for SQLite -
…sqlc[0] is leagues better than any ORM in terms of simplicity, complexity and maintainability. 0: https://github.com/kyleconroy/sqlc
comment by xyzzy_plugh · 2022-07-02 · in Show HN: Copper – A Go framework for your projects -
…without too much extra toil). Last I checked they're also working on adding sqlite support. https://github.com/kyleconroy/sqlc/
comment by andrewstuart2 · 2022-07-02 · in Show HN: Copper – A Go framework for your projects -
…being written in Go, it does look like these folks also want to do the same thing for TypeScript. https://github.com/kyleconroy/sqlc/issues/296 Given the success of packaging other Go and Rust tools into npm, like esbuild, I suspect it’s…
comment by jchw · 2022-05-29 · in Everything that makes working with databases easier -
FWIW for SQL, sqlc[1] is probably the nicest SQL layer I've used in any language. [1] https://github.com/kyleconroy/sqlc
comment by alecthomas · 2022-02-04 · in Go performance from version 1.2 to 1.18 -
…link to this issue as I couldn't see anything in official docs unless looking at the github issues. https://github.com/kyleconroy/sqlc/issues/1157
comment by Foobar8568 · 2021-09-09 · in How We Went All In on sqlc/pgx for Postgres and Go -
…documentation and actually there's a discussion on github containing queries with join statements: https://github.com/kyleconroy/sqlc/issues/213
comment by erdemozg · 2021-09-09 · in How We Went All In on sqlc/pgx for Postgres and Go -
…and also really liked the approach. Unfortunately I had to drop it temporarily due to this issue ( https://github.com/kyleconroy/sqlc/pull/983 )... which I now see is solved. Taking another look. :)
comment by KhalPanda · 2021-09-09 · in How We Went All In on sqlc/pgx for Postgres and Go -
…statement. That... is a problem. Looks like there is an open discussion about this on the project: https://github.com/kyleconroy/sqlc/discussions/1149
comment by draebek · 2021-09-09 · in How We Went All In on sqlc/pgx for Postgres and Go -
…That merge was 1.5 yr ago though, and I am curious what the plans are to take that further. [0] https://github.com/kyleconroy/sqlc/pull/331
comment by rapnie · 2021-09-09 · in How We Went All In on sqlc/pgx for Postgres and Go -
…libraries, but the caveats section gives me pause. Needing to use arrays for the IN use case (see https://github.com/kyleconroy/sqlc/issues/216 ) and the bulk insert case feel like large divergences from what "idiomatic SQL" looks like. It…
comment by grantwu · 2021-09-08 · in How We Went All In on sqlc/pgx for Postgres and Go -
…well worth checking out sqlc. It parses your migrations to generate typed structs and query funcs https://github.com/kyleconroy/sqlc
comment by Andys · 2021-08-29 · in Show HN: Typed Postgres CRUD Queries -
Doing it the other way around makes more sense, i.e. write SQL to generate code. See https://github.com/kyleconroy/sqlc , why aren't more people following this approach?
comment by mozey · 2021-08-27 · in Write an SQL query builder in 150 lines of Python -
https://github.com/kyleconroy/sqlc
comment by yawn · 2021-08-25 · in Ask HN: Companies of one, what is your tech stack? -
I've enjoyed using https://github.com/kyleconroy/sqlc on a couple of projects. Give it your schema and queries, get type-safe interfaces in return. It's a happy medium for me between all-in ORM and raw SQL.
comment by KhalPanda · 2021-04-22 · in Ask HN: Why aren't code generator ORMs more popular? -
…the mapping between database rows and Go structs. [1]: https://github.com/jschaf/pggen [2]: https://github.com/kyleconroy/sqlc
comment by sa46 · 2021-03-10 · in I don't want to learn your query language (2018) -
SQLC could be a good fit. It generates type-safe Go code from SQL. https://github.com/kyleconroy/sqlc
comment by davidspiess · 2021-03-10 · in I don't want to learn your query language (2018) -
…something I consider to be practical in today's fast paced environments. After sqlx, I gave sqlc ( https://github.com/kyleconroy/sqlc ) a try and I found it to be much more painless than any other database solution (for PostgreSQL) for…
comment by ashutoshgngwr · 2021-01-08 · in How to Work with Postgres in Go Artemiy Ryabinkov -
…it is amazing. Only issue it only supports postgres, although it has beta support for other DBs. https://github.com/kyleconroy/sqlc SQLx is good for simple read queries, but iirc for write operations you still need to map things manually…
comment by brunoluiz · 2020-11-07 · in Go in Production – Lessons Learned -
…idiomatic Go code from SQL". It makes sense to generate code from SQL and not the other way around. https://github.com/kyleconroy/sqlc
comment by mozey · 2020-10-21 · in What ORMs Have Taught Me: Just Learn SQL (2014) -
Go has something similar to this https://github.com/kyleconroy/sqlc
comment by icholy · 2020-08-13 · in Simple SQL in Python -
This is similar to sqlc for Golang: https://github.com/kyleconroy/sqlc If you're looking for the ability to generate type-safe SQL – given you write SQL correctly – this project is pretty good. Aalso a fan of SQLBoiler (…
comment by tonyhb · 2020-05-25 · in Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres -
A better equivalent in Go is https://github.com/kyleconroy/sqlc
comment by tadasv · 2020-05-25 · in Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres -
…future, so it's great to see that others in the TypeScript community find this workflow useful. [0] https://github.com/kyleconroy/sqlc
comment by conroy · 2020-05-25 · in Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres -
I maintain an open source project with ~2k stars ( https://github.com/kyleconroy/sqlc ). There’s a large list of bug reports and feature requests, but since I don’t work on it full time, I’ve gotten really good at saying “No” and “I’m…
comment by conroy · 2020-05-17 · in It’s OK for your open source library to be a bit shitty (2015) -
…supports PostgreSQL, but the plan is to support more engines and more output programming languages. https://github.com/kyleconroy/sqlc
comment by conroy · 2020-04-05 · in Ask HN: What are you learning? -
…Go and PostgreSQL are currently supported, with Kotlin and MySQL support on the way. https://github.com/kyleconroy/sqlc
comment by conroy · 2020-03-22 · in Ask HN: What projects are you working on now? -
Very cool! I maintain a similar tool: sqlc https://github.com/kyleconroy/sqlc In addition to catching SQL errors, it generates type-safe Go wrapping code. Right now it supports PostgreSQL and MySQL. I’m (obviously) a huge fan of the SQL…
comment by conroy · 2020-01-13 · in Catching SQL errors at build time -
It absolutely could, although it doesn't yet. You can track progress by following this issue: https://github.com/kyleconroy/sqlc/issues/28
comment by conroy · 2019-12-11 · in Show HN: sqlc – Compile SQL Queries to Type-Safe Go -
…), so I wrote my own for PostgreSQL. It takes existing queries and generates type-safe Go methods ( https://github.com/kyleconroy/sqlc ). I enjoy using it and thought others might too. As for migrations, I've had success with…
comment by conroy · 2019-11-08 · in Go Turns 10 -
…for your queries, automatically. It’s made a dramatic difference in my day-to-day workflow. [0] https://github.com/kyleconroy/sqlc
comment by conroy · 2019-09-20 · in What ORMs have taught me: just learn SQL (2014)