entitygen

package module
v0.0.0-...-ba27ea9 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: MIT Imports: 10 Imported by: 0

README

entitygen

ci

Tool to generate go struct from SQL static analysis

Documentation

Index

Constants

View Source
const (
	SQL_VARIANT_POSTGRES = "POSTGRES"
)

Variables

View Source
var ErrEndOfIteration = errors.New("end of iterations")

Functions

This section is empty.

Types

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

func NewGeneratorFromVariant

func NewGeneratorFromVariant(variant string, source MigrationSource, destinationPath string) (Generator, error)

func (Generator) Run

func (gen Generator) Run() error

func (*Generator) WithSchemaFilter

func (gen *Generator) WithSchemaFilter(schemas ...string) *Generator

type GoMigrateSource

type GoMigrateSource struct {
	// contains filtered or unexported fields
}

func NewGoMigrateSource

func NewGoMigrateSource(driver gomigratesource.Driver) (GoMigrateSource, error)

The driver needs to be opened before it is passed here.

func (*GoMigrateSource) Close

func (s *GoMigrateSource) Close() error

func (*GoMigrateSource) Next

func (s *GoMigrateSource) Next() (io.ReadCloser, error)

type MigrationSource

type MigrationSource interface {
	// Returns the next migration script in the correct order. If the end of the scripts is reached,
	// this method returns `ErrEndOfIteration`.
	Next() (io.ReadCloser, error)

	// Close the underlying source if needed.
	Close() error
}

MigrationSource abstracts the location and the handling of migration definitions.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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