generation

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Helpers = template.FuncMap{
	"has_primary_key":        hasPrimaryKey,
	"has_autoinc":            hasAutoIncrementingKey,
	"primary_autoinc_column": primaryAutoIncColumn,
	"autoinc_column":         autoIncColumn,
	"non_autoinc_columns":    nonAutoIncColumns,
	"lcfirst":                xstrings.FirstRuneToLower,
	"identity_columns":       identityColumns,
	"non_identity_columns":   nonIdentityColumns,
	"structify":              structify,
	"enum_columns":           enumColumns,
	"unique_column_keys":     uniqueColumnKeys,
	"sorted_columns":         sortedColumns,
	"get_type":               getType,
	"get_tags":               getTags,
}

Helpers defines the map of functions exposed to generation templates

Functions

func FmtTemplates added in v0.0.9

func FmtTemplates(outputLoc string) error

func GoimportsInstallIfNeeded added in v0.0.8

func GoimportsInstallIfNeeded() error

func InstallGoimports added in v0.0.8

func InstallGoimports() error

func IsGoimportsInstalled added in v0.0.8

func IsGoimportsInstalled() bool

func LoadSQL

func LoadSQL(paths ...string) ([]*models.Table, error)

LoadSQL loads all SQL files in the given paths and parses them

func RenderTemplates

func RenderTemplates(tables []*models.Table, templatesLoc, outputLoc string, fileExtensionPrefix string) error

func RenderWithTemplates added in v0.0.8

func RenderWithTemplates(fs embed.FS, tables []*models.Table, outputLoc string, fileExtensionPrefix string) error

RenderWithTemplates renders templates that are provided as embedded files

Types

This section is empty.

Jump to

Keyboard shortcuts

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