Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> SQLC - configuration file (yaml/json) - schema files - query files - understand the meta language in query file comments to generate code you want

I would recommend using pg_dump for your schema file which means it'll not be related to SQLC as such. This way it will be easier for you to maintain your DB, we use Goose as an example. In our setup part of the pipeline is that you write your Goose migration, and then there is an automated process which will update the DB running in your local dev DB container, do a pg_dump from that and then our dev container instance of SQLC will compile your schema for you.

The configuration file is centralized as well, so you don't have to worry about it.

I agree with you on the SQLC meta language on queries, I appreciate that it's there but we tend to avoid using it. I personally still consider the meta language a beter way of doing things than in-code SQL queries. This is a philosophical sort of thing of course, and I respect that not everyone agres with me on this. It's hard for me to comment on SQLx, however, as I haven't really used it.

What I like about SQLC is that it can be completely de-coupled from your Go code.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: