types

package
v0.0.0-...-4164891 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Migration MigrationInfo `yaml:"migration"`
	Database  DatabaseInfo  `yaml:"database"`
}

func (*Config) SetDefault

func (c *Config) SetDefault()

type DatabaseInfo

type DatabaseInfo struct {
	User     string `yaml:"user,omitempty"`
	Password string `yaml:"password,omitempty"`
	Name     string `yaml:"name,omitempty"`
	Port     string `yaml:"port,omitempty"`
	SSLMode  string `yaml:"sslmode,omitempty"`
	Host     string `yaml:"host,omitempty"`

	URL string `yaml:"url,omitempty"`
}

func (*DatabaseInfo) ConnString

func (d *DatabaseInfo) ConnString() (string, error)

func (*DatabaseInfo) ParseURL

func (d *DatabaseInfo) ParseURL() error

type Definition

type Definition struct {
	MigrationMetadata

	UpQuery   *sqlf.Query
	DownQuery *sqlf.Query
}

Definition represents the definition of a single migration. It contains what gets executed by the migration operation.

type Migration

type Migration struct {
	Up        string
	Down      string
	Metadata  string
	Timestamp int64
}

Migration represents a migration file definition.

type MigrationInfo

type MigrationInfo struct {
	TableName string `yaml:"tablename"`
	Directory string `yaml:"directory"`
}

type MigrationLog

type MigrationLog struct {
	ID            int
	Name          string
	MigrationTime time.Time
	Duration      time.Duration
}

type MigrationMetadata

type MigrationMetadata struct {
	Name      string `yaml:"name"`
	Timestamp int64  `yaml:"timestamp"`
}

MigrationMetadata represents the metadata of a migration file.

type MigrationOperationType

type MigrationOperationType int

MigrationOperationType represents the type of migration operation.

const (
	// UpMigrationOperation represents an upgrade operation.
	UpMigrationOperation MigrationOperationType = iota

	// DownMigrationOperation represents a downgrade operation.
	DownMigrationOperation
)

Jump to

Keyboard shortcuts

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