Back to Browse

Introduction to SQLC: Generate Type-Safe Go Code from SQL

489 views
Jun 5, 2025
15:31

In this video, we go over what is SQLC, why you might want to use it and finally, how to integrate to one of your projects. We go over how it can be used to generate type safe code in Go from simple SQL queries. Putting you in complete control of how you query the database. We also cover goose, a DB migration tool (other tools do exist, this just happens to be the one I am most familiar with), how it can be used with SQLC to make your queries safer, i.e. throw an error if a field does not exist on a table. Whilst allowing our schemas to change naturally. Contents: 00:00 Introduction 00:25 What is SQLC 00:37 Features of SQLC 01:30 How to use SQLC 02:02 How to install SQLC 02:39 sqlc.yaml 03:54 docker-compose.yml 04:26 query.sql 05:12 sqlc generate 05:12 Generated code 06:50 sqlc.arg 07:18 Install goose 07:42 goose migration 09:01 Demo 15:15 Outro Link to a project using sqlc: https://gitlab.com/hmajid2301/banterbus Link to side project demo'd: https://voxicle.app Website: https://haseebmajid.dev GitLab: https://gitlab.com/hmajid2301 Mastodon: https://hachyderm.io/@majiy00 ko-fi: https://ko-fi.com/haseeb36616

Download

0 formats

No download links available.

Introduction to SQLC: Generate Type-Safe Go Code from SQL | NatokHD