SQLC-Wizzard

module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT

README

SQLC-Wizzard

An interactive CLI wizard for generating production-ready sqlc v2 configurations with smart defaults.

SQLC-Wizzard guides you through creating type-safe SQL code by generating optimized sqlc.yaml configurations. Answer a few questions about your project, and get a complete setup with example queries, schema templates, and best-practice safety rules.

Features

Interactive Wizard

Start with sqlc-wizard init and answer guided questions:

$ sqlc-wizard init
? Project Type › Microservice
? Primary Database › PostgreSQL
? Go Package Path › github.com/user/my-api
✓ Created sqlc.yaml
✓ Created schema/ and queries/ directories
✓ Generated example files
Project Templates
Template Description
Hobby Simple setup for personal projects
Microservice Single database, container-optimized
Enterprise Multi-database, comprehensive validation
API-First JSON-focused, REST-friendly
Analytics Read-heavy, complex queries
Testing In-memory, mock-friendly
Multi-tenant Schema-per-tenant patterns
Library Embeddable, minimal dependencies
Database Support
  • PostgreSQL
  • MySQL
  • SQLite
Commands
Command Description
init Interactive wizard to create configuration
validate Validate existing sqlc.yaml
generate Generate example SQL files
doctor Check development environment
migrate Manage configuration migrations

Installation

Go Install
go install github.com/LarsArtmann/SQLC-Wizzard@latest
Build from Source
git clone https://github.com/LarsArtmann/SQLC-Wizzard.git
cd SQLC-Wizzard
go install ./cmd/sqlc-wizard

Usage

Interactive Mode
sqlc-wizard init
Non-Interactive Mode
sqlc-wizard init --non-interactive \
  --project-type=microservice \
  --database=postgresql \
  --package=github.com/user/myapi
Validate Configuration
sqlc-wizard validate
sqlc-wizard validate --strict
Environment Check
sqlc-wizard doctor
Generate Example Files
sqlc-wizard generate --output ./db

Project Structure

sqlc-wizzard/
├── cmd/sqlc-wizard/     # CLI entrypoint
├── internal/
│   ├── commands/        # CLI command implementations
│   ├── wizard/          # Interactive TUI wizard
│   ├── templates/       # Project templates
│   ├── generators/      # File generation
│   ├── domain/          # Domain models
│   ├── adapters/        # External interfaces
│   ├── validation/      # Configuration validation
│   └── creators/        # Project creation
├── pkg/
│   └── config/          # sqlc.yaml types
├── generated/           # TypeSpec-generated types
└── templates/           # SQL templates

Configuration

Generated configurations include sensible defaults:

version: "2"
sql:
  - engine: "postgresql"
    queries: "internal/db/queries"
    schema: "internal/db/schema"
    strict_function_checks: true
    gen:
      go:
        package: "db"
        out: "internal/db"
        emit_json_tags: true
        emit_interface: true

Development

Prerequisites
  • Go 1.21+
  • sqlc (for testing generated code)
Setup
go mod tidy
go test ./...
just build
Testing
go test ./...
go test ./internal/wizard -v
go test ./pkg/config -v

Roadmap

Completed
  • Interactive wizard with 8 project templates
  • Configuration validation
  • Environment health checks
  • PostgreSQL, MySQL, SQLite support
In Progress
  • Configuration migration tools
  • Enhanced validation rules
  • Additional template customization
Planned
  • Web-based configuration generator
  • IDE integrations
  • Cloud provider templates

License

MIT License

Directories

Path Synopsis
cmd
sqlc-wizard command
internal
adapters
Package adapters provides implementations for external system interfaces.
Package adapters provides implementations for external system interfaces.
domain
Package domain provides domain models for business logic
Package domain provides domain models for business logic
templates
Package templates provides sqlc configuration templates for different project types.
Package templates provides sqlc configuration templates for different project types.
testing
Package testing provides test helpers for both regular tests and ginkgo tests
Package testing provides test helpers for both regular tests and ginkgo tests
ui
Package ui provides shared UI styling and helpers.
Package ui provides shared UI styling and helpers.
wizard
Package wizard provides step definitions for the configuration wizard
Package wizard provides step definitions for the configuration wizard
pkg
errors
Package errors provides custom error types and error handling utilities.
Package errors provides custom error types and error handling utilities.

Jump to

Keyboard shortcuts

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