helpers

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2025 License: MIT Imports: 17 Imported by: 13

Documentation

Index

Constants

View Source
const DefaultConfigPath = "./bobgen.yaml"

Variables

This section is empty.

Functions

func DefaultOutputs added in v0.17.1

func DefaultOutputs(destination, pkgname string, noFactory bool, templates *Templates) []*gen.Output

func EnumType added in v0.26.0

func EnumType(types drivers.Types, enum string) string

func GetConfigFromFile added in v0.17.2

func GetConfigFromFile[ConstraintExtra, DriverConfig any](configPath, driverConfigKey string) (gen.Config[ConstraintExtra], DriverConfig, error)

func GetConfigFromProvider added in v0.17.2

func GetConfigFromProvider[ConstraintExtra, DriverConfig any](provider koanf.Provider, driverConfigKey string) (gen.Config[ConstraintExtra], DriverConfig, error)

func GetFreePort added in v0.26.0

func GetFreePort() (int, error)

func Migrate added in v0.26.0

func Migrate(ctx context.Context, db *sql.DB, dir fs.FS, pattern string) error

func Types added in v0.24.0

func Types() drivers.Types

func Version

func Version() string

Types

type Config added in v0.37.0

type Config struct {
	// Which `database` driver to use (the full module name)
	Driver string `yaml:"driver"`
	// The database connection string
	Dsn string
	// List of tables that will be included. Others are ignored
	Only map[string][]string
	// Folders containing query files
	Queries []string `yaml:"queries"`
	// List of tables that will be should be ignored. Others are included
	Except map[string][]string

	// The name of the folder to output the models package to
	Output string
	// The name you wish to assign to your generated models package
	Pkgname   string
	NoFactory bool `yaml:"no_factory"`
}

type Templates added in v0.17.1

type Templates struct {
	Models  []fs.FS
	Factory []fs.FS
	Queries []fs.FS
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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