Skip to content
On this page

Go Structs

go

Generate plain Go structs with json struct tags from SQL schema

Usage

Add to your sqldoc.config.ts:

typescript
export default {
  dialect: 'postgres',
  schema: ['./schema.sql'],
  codegen: [
    {
      template: 'go-structs',
      output: './generated/models.go',
    },
  ],
}

Then run:

bash
sqldoc codegen