Skip to content

Latest commit

History

History
50 lines (38 loc) 路 1.02 KB

CONFIGURATION.md

File metadata and controls

50 lines (38 loc) 路 1.02 KB

Configuration

sqlgen can be configured using a sqlgen.yml, sqlgen.yml, .sqlgen.yaml or sqlgen.yaml file, by default it will be loaded from the current directory.

Example :

# Where are all the model files located? globs are supported eg  src/**/*.go
src:
  - ./**/*

# Optional:
# Possibly values : `mysql`, `postgres` or `sqlite`
driver: mysql

# Optional:
# Possibly values : `snake_case`, `camelCase` or `PascalCase`
naming_convention: snake_case

# Optional:
struct_tag: sql

# Optional:
skip_escape: false

# Optional: Where should the generated model code go?
exec:
  skip_empty: false
  filename: generated.go

# Optional: Where should the generated database code go?
database:
  dir: db
  package: db
  filename: db.go
  operator:
    dir: db
    filename: operator.go

# Optional:
strict: true

# Optional: turn on to not generate any file header in generated files
skip_header: false

# Optional:
source_map: false
# Optional: set to skip running `go mod tidy` when generating server code
# skip_mod_tidy: false