translators

package
v1.14.4 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 6 Imported by: 54

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cockroach

type Cockroach struct {
	Schema SchemaQuery
}

func NewCockroach

func NewCockroach(url string, name string) *Cockroach

func (*Cockroach) AddColumn

func (p *Cockroach) AddColumn(t fizz.Table) (string, error)

func (*Cockroach) AddForeignKey

func (p *Cockroach) AddForeignKey(t fizz.Table) (string, error)

func (*Cockroach) AddIndex

func (p *Cockroach) AddIndex(t fizz.Table) (string, error)

func (*Cockroach) ChangeColumn

func (p *Cockroach) ChangeColumn(t fizz.Table) (string, error)

func (*Cockroach) CreateTable

func (p *Cockroach) CreateTable(t fizz.Table) (string, error)

func (*Cockroach) DropColumn

func (p *Cockroach) DropColumn(t fizz.Table) (string, error)

func (*Cockroach) DropForeignKey

func (p *Cockroach) DropForeignKey(t fizz.Table) (string, error)

func (*Cockroach) DropIndex

func (p *Cockroach) DropIndex(t fizz.Table) (string, error)

func (*Cockroach) DropTable

func (p *Cockroach) DropTable(t fizz.Table) (string, error)

func (Cockroach) Name added in v1.9.3

func (Cockroach) Name() string

func (*Cockroach) RenameColumn

func (p *Cockroach) RenameColumn(t fizz.Table) (string, error)

func (*Cockroach) RenameIndex

func (p *Cockroach) RenameIndex(t fizz.Table) (string, error)

func (*Cockroach) RenameTable

func (p *Cockroach) RenameTable(t []fizz.Table) (string, error)

type MariaDB added in v1.3.0

type MariaDB struct {
	*MySQL
}

MariaDB is a MariaDB-specific translator.

func NewMariaDB added in v1.3.0

func NewMariaDB(url, name string) *MariaDB

NewMariaDB constructs a new MariaDB translator.

func (MariaDB) Name added in v1.9.3

func (MariaDB) Name() string

type MsSqlServer added in v1.1.0

type MsSqlServer struct{}

MsSqlServer is a MS SqlServer-specific translator.

func NewMsSqlServer added in v1.1.0

func NewMsSqlServer() *MsSqlServer

NewMsSqlServer constructs a new MsSqlServer translator.

func (*MsSqlServer) AddColumn added in v1.1.0

func (p *MsSqlServer) AddColumn(t fizz.Table) (string, error)

func (*MsSqlServer) AddForeignKey added in v1.1.0

func (p *MsSqlServer) AddForeignKey(t fizz.Table) (string, error)

func (*MsSqlServer) AddIndex added in v1.1.0

func (p *MsSqlServer) AddIndex(t fizz.Table) (string, error)

func (*MsSqlServer) ChangeColumn added in v1.1.0

func (p *MsSqlServer) ChangeColumn(t fizz.Table) (string, error)

func (*MsSqlServer) CreateTable added in v1.1.0

func (p *MsSqlServer) CreateTable(t fizz.Table) (string, error)

func (*MsSqlServer) DropColumn added in v1.1.0

func (p *MsSqlServer) DropColumn(t fizz.Table) (string, error)

func (*MsSqlServer) DropForeignKey added in v1.1.0

func (p *MsSqlServer) DropForeignKey(t fizz.Table) (string, error)

func (*MsSqlServer) DropIndex added in v1.1.0

func (p *MsSqlServer) DropIndex(t fizz.Table) (string, error)

func (*MsSqlServer) DropTable added in v1.1.0

func (p *MsSqlServer) DropTable(t fizz.Table) (string, error)

func (MsSqlServer) Name added in v1.9.3

func (MsSqlServer) Name() string

func (*MsSqlServer) RenameColumn added in v1.1.0

func (p *MsSqlServer) RenameColumn(t fizz.Table) (string, error)

func (*MsSqlServer) RenameIndex added in v1.1.0

func (p *MsSqlServer) RenameIndex(t fizz.Table) (string, error)

func (*MsSqlServer) RenameTable added in v1.1.0

func (p *MsSqlServer) RenameTable(t []fizz.Table) (string, error)

type MySQL

type MySQL struct {
	Schema SchemaQuery
	// contains filtered or unexported fields
}

MySQL is a MySQL-specific translator.

func NewMySQL

func NewMySQL(url, name string) *MySQL

NewMySQL constructs a new MySQL translator.

func (*MySQL) AddColumn

func (p *MySQL) AddColumn(t fizz.Table) (string, error)

func (*MySQL) AddForeignKey

func (p *MySQL) AddForeignKey(t fizz.Table) (string, error)

func (*MySQL) AddIndex

func (p *MySQL) AddIndex(t fizz.Table) (string, error)

func (*MySQL) ChangeColumn

func (p *MySQL) ChangeColumn(t fizz.Table) (string, error)

func (*MySQL) CreateTable

func (p *MySQL) CreateTable(t fizz.Table) (string, error)

CreateTable translates a fizz Table to its MySQL SQL definition.

func (*MySQL) DropColumn

func (p *MySQL) DropColumn(t fizz.Table) (string, error)

func (*MySQL) DropForeignKey

func (p *MySQL) DropForeignKey(t fizz.Table) (string, error)

func (*MySQL) DropIndex

func (p *MySQL) DropIndex(t fizz.Table) (string, error)

func (*MySQL) DropTable

func (p *MySQL) DropTable(t fizz.Table) (string, error)

func (MySQL) Name added in v1.9.3

func (MySQL) Name() string

func (*MySQL) RenameColumn

func (p *MySQL) RenameColumn(t fizz.Table) (string, error)

func (*MySQL) RenameIndex

func (p *MySQL) RenameIndex(t fizz.Table) (string, error)

func (*MySQL) RenameTable

func (p *MySQL) RenameTable(t []fizz.Table) (string, error)

type Postgres

type Postgres struct {
}

func NewPostgres

func NewPostgres() *Postgres

func (*Postgres) AddColumn

func (p *Postgres) AddColumn(t fizz.Table) (string, error)

func (*Postgres) AddForeignKey

func (p *Postgres) AddForeignKey(t fizz.Table) (string, error)

func (*Postgres) AddIndex

func (p *Postgres) AddIndex(t fizz.Table) (string, error)

func (*Postgres) ChangeColumn

func (p *Postgres) ChangeColumn(t fizz.Table) (string, error)

func (*Postgres) CreateTable

func (p *Postgres) CreateTable(t fizz.Table) (string, error)

func (*Postgres) DropColumn

func (p *Postgres) DropColumn(t fizz.Table) (string, error)

func (*Postgres) DropForeignKey

func (p *Postgres) DropForeignKey(t fizz.Table) (string, error)

func (*Postgres) DropIndex

func (p *Postgres) DropIndex(t fizz.Table) (string, error)

func (*Postgres) DropTable

func (p *Postgres) DropTable(t fizz.Table) (string, error)

func (Postgres) Name added in v1.9.3

func (Postgres) Name() string

func (*Postgres) RenameColumn

func (p *Postgres) RenameColumn(t fizz.Table) (string, error)

func (*Postgres) RenameIndex

func (p *Postgres) RenameIndex(t fizz.Table) (string, error)

func (*Postgres) RenameTable

func (p *Postgres) RenameTable(t []fizz.Table) (string, error)

type SQLite

type SQLite struct {
	Schema SchemaQuery
}

func NewSQLite

func NewSQLite(url string) *SQLite

func (*SQLite) AddColumn

func (p *SQLite) AddColumn(t fizz.Table) (string, error)

func (*SQLite) AddForeignKey

func (p *SQLite) AddForeignKey(t fizz.Table) (string, error)

func (*SQLite) AddIndex

func (p *SQLite) AddIndex(t fizz.Table) (string, error)

func (*SQLite) ChangeColumn

func (p *SQLite) ChangeColumn(t fizz.Table) (string, error)

func (*SQLite) CreateTable

func (p *SQLite) CreateTable(t fizz.Table) (string, error)

func (*SQLite) DropColumn

func (p *SQLite) DropColumn(t fizz.Table) (string, error)

func (*SQLite) DropForeignKey

func (p *SQLite) DropForeignKey(t fizz.Table) (string, error)

func (*SQLite) DropIndex

func (p *SQLite) DropIndex(t fizz.Table) (string, error)

func (*SQLite) DropTable

func (p *SQLite) DropTable(t fizz.Table) (string, error)

func (SQLite) Name added in v1.9.3

func (SQLite) Name() string

func (*SQLite) RenameColumn

func (p *SQLite) RenameColumn(t fizz.Table) (string, error)

func (*SQLite) RenameIndex

func (p *SQLite) RenameIndex(t fizz.Table) (string, error)

func (*SQLite) RenameTable

func (p *SQLite) RenameTable(t []fizz.Table) (string, error)

type Schema

type Schema struct {
	Builder SchemaQuery
	Name    string
	URL     string
	// contains filtered or unexported fields
}

func CreateSchema

func CreateSchema(name string, url string, schema map[string]*fizz.Table) Schema

func (*Schema) Build

func (s *Schema) Build() error

func (*Schema) ColumnInfo

func (s *Schema) ColumnInfo(table string, column string) (*fizz.Column, error)

func (*Schema) Delete

func (s *Schema) Delete(table string)

func (*Schema) DeleteColumn

func (s *Schema) DeleteColumn(table string, column string)

func (*Schema) IndexInfo

func (s *Schema) IndexInfo(table string, idx string) (*fizz.Index, error)

func (*Schema) ReplaceColumn

func (s *Schema) ReplaceColumn(table string, oldColumn string, newColumn fizz.Column) error

func (*Schema) ReplaceSchema

func (s *Schema) ReplaceSchema(newSchema map[string]*fizz.Table)

func (*Schema) SetTable

func (s *Schema) SetTable(table *fizz.Table)

func (*Schema) TableInfo

func (s *Schema) TableInfo(table string) (*fizz.Table, error)

type SchemaQuery

type SchemaQuery interface {
	ReplaceSchema(map[string]*fizz.Table)
	Build() error
	TableInfo(string) (*fizz.Table, error)
	ReplaceColumn(table string, oldColumn string, newColumn fizz.Column) error
	ColumnInfo(table string, column string) (*fizz.Column, error)
	IndexInfo(table string, idx string) (*fizz.Index, error)
	Delete(string)
	SetTable(*fizz.Table)
	DeleteColumn(string, string)
}

Jump to

Keyboard shortcuts

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