sqlc

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSqlcConfig

func BuildSqlcConfig(schema *config.SchemaConfig) *sqlcConfig

BuildSqlcConfig constructs a sqlc.yaml config from a pgxgen v2 schema. All paths are prefixed with "../" because the generated sqlc.yaml lives in .pgxgen/sqlc.yaml (one level deeper than the project root).

func PostProcess

func PostProcess(l logger.Logger, configDir string, schema *config.SchemaConfig, cfg *sqlcConfig) error

PostProcess handles: 1. Removing models.go from each sqlc output dir 2. Replacing bare type references with qualified imports (User → models.User)

Types

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator handles sqlc config generation and invocation.

func NewGenerator

func NewGenerator(l logger.Logger, configDir string) *Generator

NewGenerator creates a new sqlc generator.

func (*Generator) Run

func (g *Generator) Run(schema *config.SchemaConfig) error

Run generates sqlc.yaml and invokes sqlc for the given schema.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL