Codegen Driven Development
summary
Build automates cql compilation and emits Swift wrappers so SQL business logic becomes type‑safe Swift APIs. Uses cgsql’s cql compiler as a prebuild rule, writes its JSON output to derived sources, runs a Swift codegen tool and produces structs, query/mutation functions and subscription hooks attached to a mailbox dependency. Demo app Deluge shows an “add item” stored procedure that persists to SQLite, returns typed rows and automatically refreshes views; Xcode build log shows the cql run and “build succeeded,” and the live simulator creates and retains records.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:51Business logic importance
- 2:52Encapsulating logic with SQL
- 5:20What is CGSQL
- 7:10Live coding demo
- 12:33Why this approach works
- 13:15CGSQL language features
- 15:24Automating CQL compilation
- 19:16Making API Swifty
- 23:14Code generation script
- 26:44Generating Swift code
- 33:47System workflow summary
- 36:58IDE plugin for CQL
- 38:02Q&A
related talks
36mGenerating code in Go
37mGenerating Developer-Friendly SDKs with Firebase Data Connect
20mYou don't need an ORM
42mBecoming the Metaprogrammer Real World Code Generation
29mClosing the Loop: How GraphQL Gives Coding Agents Eyes on What Actually Matters
20mDon’t Worry, Be Lazy
45mTooling in Swift - Xcode Integration & CI
07mHow to Code Boring Internal Apps 10x Faster
