schema

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 12 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"`
	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"`
	Dependencies bool     `help:"optional, to discover all dependencies"`
	Out          string   `help:"schema folder name to store files"`
	Package      string   `help:"package name to override from --out path"`
	Imports      []string `help:"optional go imports"`
}

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: DataHub|DataHub.BrokerData|DataHub.HubspotData" 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"`
}

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"`
}

PrintTablesCmd prints database tables with dependencies

func (*PrintTablesCmd) Run

func (a *PrintTablesCmd) 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