exporter

package
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package exporter provides functionality for exporting database migrations and schemas.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Format    ExportFormat
	Dialect   plugins.Dialect
	OutputDir string
	AuthOnly  bool
	Plugins   []plugins.Plugin // Plugin instances to export
}

Config configures the migration exporter.

type ExportFormat

type ExportFormat string

ExportFormat defines the output format for migration exports.

const (
	// FormatSQL exports migrations as plain SQL files.
	FormatSQL ExportFormat = "sql"
	// FormatGoose exports migrations in Goose format.
	FormatGoose ExportFormat = "goose"
	// FormatGolangMigrate exports migrations in golang-migrate format.
	FormatGolangMigrate ExportFormat = "golang-migrate"
)

type Exporter

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

Exporter handles exporting migrations to various formats

func NewExporter

func NewExporter(config Config) *Exporter

NewExporter creates a new migration exporter with the provided configuration.

func (*Exporter) Export

func (e *Exporter) Export() error

Export writes migrations to disk in the specified format

type Migration

type Migration struct {
	Number      int
	Up          string
	Down        string
	Version     string
	Description string
}

Migration represents a single migration

type SchemaExporter

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

SchemaExporter handles exporting schemas

func NewSchemaExporter

func NewSchemaExporter(config SchemaExporterConfig) *SchemaExporter

NewSchemaExporter creates a new schema exporter

func (*SchemaExporter) Export

func (e *SchemaExporter) Export() error

Export writes schemas to disk

type SchemaExporterConfig

type SchemaExporterConfig struct {
	Dialect   plugins.Dialect
	OutputDir string
	AuthOnly  bool
	Plugins   []plugins.Plugin // Plugin instances to export
}

SchemaExporterConfig configures the schema exporter

Jump to

Keyboard shortcuts

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