exporter

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const DiagramExporterName = "diagram"
View Source
const GoSQLMigrateExporterName = "go-sql-migrate"
View Source
const GoStructsExporterName = "go-structs"
View Source
const GooseExporterName = "goose"
View Source
const GooseFixturesExporterName = "goose-fixtures"
View Source
const GrpcCrudExporterName = "grpc-crud"
View Source
const LaravelMigrationsRawExporterName = "laravel-migrations-raw"
View Source
const MarkdownExporterName = "md"
View Source
const (
	YamlFixturesExporterName = "yaml-fixtures"
)

Variables

Functions

This section is empty.

Types

type DiagramExporter

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

func (*DiagramExporter) Export

func (*DiagramExporter) ExportPerFile

func (e *DiagramExporter) ExportPerFile(
	_ context.Context,
	sch *schema.Schema,
	_ *ExportParams,
) ([]*ExportedPage, error)

func (DiagramExporter) Import added in v0.2.0

func (DiagramExporter) Import(_ context.Context, _ *schema.Schema, _ *ImportParams) ([]ImportedFile, error)

func (DiagramExporter) ImportPerFile added in v0.2.0

func (DiagramExporter) ImportPerFile(
	_ context.Context,
	_ *schema.Schema,
	_ *ImportParams,
) ([]ImportedFile, error)

type ExportParams

type ExportParams struct {
	WithDiagram            bool
	WithoutMigrationsTable bool
	Package                string
}

type ExportedPage

type ExportedPage struct {
	FileName string
	Content  []byte
}

func (*ExportedPage) Valid

func (p *ExportedPage) Valid() bool

type Exporter

type Exporter interface {
	Importer
	ExportPerFile(_ context.Context, sc *schema.Schema, params *ExportParams) ([]*ExportedPage, error)
	Export(ctx context.Context, schema *schema.Schema, params *ExportParams) ([]*ExportedPage, error)
}

func CreateExporter

func CreateExporter(name string, renderer *template.Renderer, connection *db.Connection) (Exporter, error)

func NewDiagramExporter

func NewDiagramExporter(renderer *template.Renderer) Exporter

func NewGoStructsExporter

func NewGoStructsExporter(renderer *template.Renderer) Exporter

func NewMarkdownExporter

func NewMarkdownExporter(renderer *template.Renderer) Exporter

type GoSQLMigrateExporter

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

func NewSQLMigrateExporter

func NewSQLMigrateExporter(renderer *template.Renderer, ddlBuilder *sql.DDLBuilder) *GoSQLMigrateExporter

func (*GoSQLMigrateExporter) Export

func (*GoSQLMigrateExporter) ExportPerFile

func (e *GoSQLMigrateExporter) ExportPerFile(
	_ context.Context,
	sch *schema.Schema,
	_ *ExportParams,
) ([]*ExportedPage, error)

func (GoSQLMigrateExporter) Import added in v0.2.0

func (GoSQLMigrateExporter) Import(_ context.Context, _ *schema.Schema, _ *ImportParams) ([]ImportedFile, error)

func (GoSQLMigrateExporter) ImportPerFile added in v0.2.0

func (GoSQLMigrateExporter) ImportPerFile(
	_ context.Context,
	_ *schema.Schema,
	_ *ImportParams,
) ([]ImportedFile, error)

type GoStructsExporter

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

func (*GoStructsExporter) Export

func (e *GoStructsExporter) Export(
	_ context.Context,
	schema *schema.Schema,
	params *ExportParams,
) ([]*ExportedPage, error)

func (*GoStructsExporter) ExportPerFile

func (e *GoStructsExporter) ExportPerFile(
	_ context.Context,
	sch *schema.Schema,
	params *ExportParams,
) ([]*ExportedPage, error)

func (GoStructsExporter) Import added in v0.2.0

func (GoStructsExporter) Import(_ context.Context, _ *schema.Schema, _ *ImportParams) ([]ImportedFile, error)

func (GoStructsExporter) ImportPerFile added in v0.2.0

func (GoStructsExporter) ImportPerFile(
	_ context.Context,
	_ *schema.Schema,
	_ *ImportParams,
) ([]ImportedFile, error)

type GooseExporter

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

func NewGooseExporter

func NewGooseExporter(renderer *template.Renderer, ddlBuilder *sql.DDLBuilder) *GooseExporter

func (*GooseExporter) Export

func (e *GooseExporter) Export(ctx context.Context, sch *schema.Schema, _ *ExportParams) ([]*ExportedPage, error)

func (*GooseExporter) ExportPerFile

func (e *GooseExporter) ExportPerFile(
	ctx context.Context,
	sch *schema.Schema,
	_ *ExportParams,
) ([]*ExportedPage, error)

func (GooseExporter) Import added in v0.2.0

func (GooseExporter) Import(_ context.Context, _ *schema.Schema, _ *ImportParams) ([]ImportedFile, error)

func (GooseExporter) ImportPerFile added in v0.2.0

func (GooseExporter) ImportPerFile(
	_ context.Context,
	_ *schema.Schema,
	_ *ImportParams,
) ([]ImportedFile, error)

type GooseFixturesExporter added in v0.1.1

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

func NewGooseFixturesExporter added in v0.1.1

func NewGooseFixturesExporter(
	dataLoader *db.DataLoader,
	renderer *template.Renderer,
	insertBuilder *sql.QueryBuilder,
) *GooseFixturesExporter

func (*GooseFixturesExporter) Export added in v0.1.1

func (*GooseFixturesExporter) ExportPerFile added in v0.1.1

func (e *GooseFixturesExporter) ExportPerFile(
	ctx context.Context,
	sch *schema.Schema,
	_ *ExportParams,
) ([]*ExportedPage, error)

func (GooseFixturesExporter) Import added in v0.2.0

func (GooseFixturesExporter) Import(_ context.Context, _ *schema.Schema, _ *ImportParams) ([]ImportedFile, error)

func (GooseFixturesExporter) ImportPerFile added in v0.2.0

func (GooseFixturesExporter) ImportPerFile(
	_ context.Context,
	_ *schema.Schema,
	_ *ImportParams,
) ([]ImportedFile, error)

type GrpcCrudExporter added in v0.1.1

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

func NewGrpcCrudExporter added in v0.1.1

func NewGrpcCrudExporter(renderer *template.Renderer) *GrpcCrudExporter

func (*GrpcCrudExporter) Export added in v0.1.1

func (e *GrpcCrudExporter) Export(
	_ context.Context,
	sc *schema.Schema,
	params *ExportParams,
) ([]*ExportedPage, error)

func (*GrpcCrudExporter) ExportPerFile added in v0.1.1

func (e *GrpcCrudExporter) ExportPerFile(
	_ context.Context,
	sc *schema.Schema,
	params *ExportParams,
) ([]*ExportedPage, error)

func (GrpcCrudExporter) Import added in v0.2.0

func (GrpcCrudExporter) Import(_ context.Context, _ *schema.Schema, _ *ImportParams) ([]ImportedFile, error)

func (GrpcCrudExporter) ImportPerFile added in v0.2.0

func (GrpcCrudExporter) ImportPerFile(
	_ context.Context,
	_ *schema.Schema,
	_ *ImportParams,
) ([]ImportedFile, error)

type ImportParams added in v0.2.0

type ImportParams struct {
	Directory   *fs.Directory
	TableFilter func(tableName string) bool
}

type ImportedFile added in v0.2.0

type ImportedFile struct {
	AffectedRows map[string]int64
	Name         string
}

type Importer added in v0.2.0

type Importer interface {
	Import(ctx context.Context, schema *schema.Schema, params *ImportParams) ([]ImportedFile, error)
	ImportPerFile(ctx context.Context, sc *schema.Schema, params *ImportParams) ([]ImportedFile, error)
}

type LaravelMigrationsRawExporter

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

func NewLaravelMigrationsRawExporter

func NewLaravelMigrationsRawExporter(
	renderer *template.Renderer,
	ddlBuilder *sql.DDLBuilder,
) *LaravelMigrationsRawExporter

func (*LaravelMigrationsRawExporter) Export

func (*LaravelMigrationsRawExporter) ExportPerFile

func (LaravelMigrationsRawExporter) Import added in v0.2.0

func (LaravelMigrationsRawExporter) Import(_ context.Context, _ *schema.Schema, _ *ImportParams) ([]ImportedFile, error)

func (LaravelMigrationsRawExporter) ImportPerFile added in v0.2.0

func (LaravelMigrationsRawExporter) ImportPerFile(
	_ context.Context,
	_ *schema.Schema,
	_ *ImportParams,
) ([]ImportedFile, error)

type MarkdownExporter

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

func (*MarkdownExporter) Export

func (e *MarkdownExporter) Export(
	_ context.Context,
	schema *schema.Schema,
	params *ExportParams,
) ([]*ExportedPage, error)

func (*MarkdownExporter) ExportPerFile

func (e *MarkdownExporter) ExportPerFile(
	_ context.Context,
	sc *schema.Schema,
	params *ExportParams,
) ([]*ExportedPage, error)

func (MarkdownExporter) Import added in v0.2.0

func (MarkdownExporter) Import(_ context.Context, _ *schema.Schema, _ *ImportParams) ([]ImportedFile, error)

func (MarkdownExporter) ImportPerFile added in v0.2.0

func (MarkdownExporter) ImportPerFile(
	_ context.Context,
	_ *schema.Schema,
	_ *ImportParams,
) ([]ImportedFile, error)

type YamlFixturesExporter added in v0.1.3

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

func NewYamlFixturesExporter added in v0.1.3

func NewYamlFixturesExporter(
	dataLoader *db.DataLoader,
	renderer *template.Renderer,
	inserter *db.Inserter,
	conn *db.Connection,
) *YamlFixturesExporter

func (*YamlFixturesExporter) Export added in v0.1.3

func (e *YamlFixturesExporter) Export(
	ctx context.Context,
	sch *schema.Schema,
	_ *ExportParams,
) ([]*ExportedPage, error)

func (*YamlFixturesExporter) ExportPerFile added in v0.1.3

func (e *YamlFixturesExporter) ExportPerFile(
	ctx context.Context,
	sch *schema.Schema,
	_ *ExportParams,
) ([]*ExportedPage, error)

func (*YamlFixturesExporter) Import added in v0.2.0

func (e *YamlFixturesExporter) Import(ctx context.Context, sch *schema.Schema, params *ImportParams) (
	[]ImportedFile,
	error,
)

func (YamlFixturesExporter) ImportPerFile added in v0.2.0

func (YamlFixturesExporter) ImportPerFile(
	_ context.Context,
	_ *schema.Schema,
	_ *ImportParams,
) ([]ImportedFile, error)

Jump to

Keyboard shortcuts

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