SQL-first application development with sqlc

  • Nikolay is a Senior Software Engineer at Zalando Finland, Docker Captain. He is an author of sqlc++ and pgx-outbox projects in Go and change data capture enthusiast. He is a regular international conferences and Helsinki meetups speaker.

    https://github.com/nikolayk812

Category: Developer Level: Intermediate Language: EN Tag: Reserve

Sqlc lets application developers use Postgres with full SQL expressiveness while still getting type-safe code in their language of choice. By generating strongly typed query wrappers directly from SQL files, sqlc removes an entire class of runtime errors — but using it effectively in production brings its own set of challenges.

This talk shares practical patterns for getting the most out of sqlc when building Postgres-backed applications. We’ll look at how to structure queries (including conditional and dynamic ones), how to think about type mapping between Postgres and the target language, and how to keep your application’s domain model from leaking database schema details. While sqlc supports multiple languages, the examples will use Go, where the toolchain is most mature.

You’ll also see how to keep sqlc-generated code cleanly contained within a data-access layer, and how to design tests that validate queries against a real Postgres instance.

Takeaways:

  • Practical patterns for structuring SQL and handling dynamic queries with sqlc.
  • Guidance on Postgres-to-language type mapping and avoiding schema leakage.
  • Techniques for organizing code and tests to keep sqlc reliable in production.
Back

Join Us For Swiss PGDay 2026

25 & 26 June 2026

Rapperswil, Switzerland