After Opendoor adopted the GORM Golang library as its database library, developers were spending too much time translating SQL queries into GORM method calls and maintaining the Golang model structs when new columns or tables were added. To address these pain points, Opendoor engineers developed and OSS’ed pggen, a code-generator that automatically generates a Go routine for each SQL query that it executes. pggen enables users to interface with Postgres using SQL (instead of a query builder) and ensures that all Go code remains in sync with the database. Pggen, which is compatible with GORM, can also automatically generate model structs and basic CRUD methods for each struct.