drivers

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	Close() error
	Diff(ctx context.Context) (string, error)
}

type SQLLiteDriverConfig

type SQLLiteDriverConfig struct {
	SourceDatabasePath string
	TargetDatabasePath string
}

type SQLiteColumn

type SQLiteColumn struct {
	Name       string
	Type       string
	NotNull    bool
	PrimaryKey bool
	Default    sql.NullString
}

func (*SQLiteColumn) Copy

func (c *SQLiteColumn) Copy() *SQLiteColumn

func (*SQLiteColumn) HasEqualAttributes

func (c *SQLiteColumn) HasEqualAttributes(other *SQLiteColumn) bool

func (*SQLiteColumn) String

func (c *SQLiteColumn) String() string

type SQLiteDriver

type SQLiteDriver struct {
	SourceDatabaseConnection *sql.DB
	TargetDatabaseConnection *sql.DB
}

func NewSQLiteDriver

func NewSQLiteDriver(config *SQLLiteDriverConfig) (*SQLiteDriver, error)

func (*SQLiteDriver) Close

func (d *SQLiteDriver) Close() error

func (*SQLiteDriver) Diff

func (d *SQLiteDriver) Diff(ctx context.Context) (string, error)

type SQLiteIndex

type SQLiteIndex struct {
	Table   string
	Name    string
	Columns []string
	Unique  bool
}

func (*SQLiteIndex) Equal

func (i *SQLiteIndex) Equal(other *SQLiteIndex) bool

func (*SQLiteIndex) String

func (i *SQLiteIndex) String() string

type SQLiteTable

type SQLiteTable struct {
	Name     string
	Columns  []*SQLiteColumn
	Indexes  []*SQLiteIndex
	Triggers []*SQLiteTrigger
}

func (*SQLiteTable) ColumnByName

func (t *SQLiteTable) ColumnByName(name string) (*SQLiteColumn, bool)

func (*SQLiteTable) Copy

func (t *SQLiteTable) Copy() *SQLiteTable

func (*SQLiteTable) CreateTableOnlyString

func (t *SQLiteTable) CreateTableOnlyString() string

CreateTableOnlyString returns the CREATE TABLE statement without indexes. (Used for the table-rebuild path so indexes can be recreated after rename.)

func (*SQLiteTable) IndexByName

func (t *SQLiteTable) IndexByName(name string) (*SQLiteIndex, bool)

func (*SQLiteTable) String

func (t *SQLiteTable) String() string

func (*SQLiteTable) TriggerByName

func (t *SQLiteTable) TriggerByName(name string) (*SQLiteTrigger, bool)

type SQLiteTrigger

type SQLiteTrigger struct {
	Name string
	SQL  string
}

Jump to

Keyboard shortcuts

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