Help us shape the future of Go! Take the 2026 Go Developer Survey

schema

package
v1.0.166 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package schema provides CLI commands

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	Generate    GenerateCmd     `cmd:"" help:"generate Go model for database schema"`
	Columns     PrintColumnsCmd `cmd:"" help:"prints database schema"`
	Tables      PrintTablesCmd  `cmd:"" help:"prints database tables and dependencies"`
	Views       PrintViewsCmd   `cmd:"" help:"prints database views and dependencies"`
	ForeignKeys PrintFKCmd      `cmd:"" help:"prints Foreign Keys"`
}

Cmd base command for schema

type GenerateCmd

type GenerateCmd struct {
	DB           string   `help:"database name" required:""`
	Schema       []string `help:"optional schema name to filter"`
	Table        []string `help:"optional, list of tables, default: all tables"`
	View         []string `help:"optional, list of views"`
	Dependencies bool     `help:"optional, to discover all dependencies"`
	OutModel     string   `help:"folder name to store model files"`
	OutSchema    string   `help:"folder name to store schema files"`
	PkgModel     string   `help:"package name to override from --out-model path"`
	PkgSchema    string   `help:"package name to override from --out-schema path"`
	StructSuffix string   `help:"optional, suffix for struct names"`
	Imports      []string `help:"optional go imports"`
	UseSchema    bool     `help:"optional, use schema name in table name"`
	TypesDef     string   `help:"optional, path to types definition file"`
}

GenerateCmd generates database schema

func (*GenerateCmd) Run

func (a *GenerateCmd) Run(ctx *cli.Cli) error

Run the command

type PrintColumnsCmd

type PrintColumnsCmd struct {
	DB           string   `help:"database name" required:""`
	Schema       []string `help:"optional schema name to filter"`
	Table        []string `help:"optional, list of tables, default: all tables"`
	Dependencies bool     `help:"optional, to discover all dependencies"`
	Views        bool     `help:"optional, to include views"`
}

PrintColumnsCmd prints database schema

func (*PrintColumnsCmd) Run

func (a *PrintColumnsCmd) Run(ctx *cli.Cli) error

Run the command

type PrintFKCmd

type PrintFKCmd struct {
	DB     string   `help:"database name" required:""`
	Schema []string `help:"optional schema name to filter"`
	Table  []string `help:"optional, list of tables, default: all tables"`
}

PrintFKCmd prints database FK

func (*PrintFKCmd) Run

func (a *PrintFKCmd) Run(ctx *cli.Cli) error

Run the command

type PrintTablesCmd

type PrintTablesCmd struct {
	DB     string   `help:"database name" required:""`
	Schema []string `help:"optional schema name to filter"`
	Table  []string `help:"optional, list of tables, default: all tables"`
	Views  bool     `help:"optional, to include views"`
}

PrintTablesCmd prints database tables with dependencies

func (*PrintTablesCmd) Run

func (a *PrintTablesCmd) Run(ctx *cli.Cli) error

Run the command

type PrintViewsCmd

type PrintViewsCmd struct {
	DB     string   `help:"database name" required:""`
	Schema []string `help:"optional schema name to filter"`
	View   []string `help:"optional, list of views, default: all views"`
}

PrintViewsCmd prints database tables with dependencies

func (*PrintViewsCmd) Run

func (a *PrintViewsCmd) Run(ctx *cli.Cli) error

Run the command

Jump to

Keyboard shortcuts

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