alter

package
v0.0.0-...-28ac8a9 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReColumn = iota + 0
	ReTable
)
View Source
const (
	RenameTable = iota + 1
	DropColumns
	RenameColumns
	ModifyColumns
	AddColumns
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddColumn

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

func (*AddColumn) Column

func (a *AddColumn) Column(name string, fieldType *query.DataType, constrains *query.Constrain) *AddColumn

func (*AddColumn) Execute

func (a *AddColumn) Execute() (sql.Result, error)

func (*AddColumn) InsertAt

func (a *AddColumn) InsertAt(insertAfter bool, existingColumn string) *AddColumn

type AddNewColumn

type AddNewColumn interface {
	Column(name string, fieldType *query.DataType, constrains *query.Constrain) *AddColumn
	Service
}

func NewAddColumn

func NewAddColumn(table *Table) AddNewColumn

type Rename

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

func (*Rename) Column

func (r *Rename) Column(name, newName string, fieldType *query.DataType, constrains *query.Constrain, options ...interface{}) *Rename

func (*Rename) Execute

func (r *Rename) Execute() (sql.Result, error)

func (*Rename) Table

func (r *Rename) Table(newName string) *Rename

type RenameItem

type RenameItem interface {
	Column(name, newName string, fieldType *query.DataType, constrains *query.Constrain, options ...interface{}) *Rename
	Table(newName string) *Rename
	Service
}

func NewRename

func NewRename(table *Table) RenameItem

type Service

type Service interface {
	Execute() (sql.Result, error)
	// contains filtered or unexported methods
}

type Table

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

Table struct

func (*Table) Add

func (t *Table) Add() AddNewColumn

func (*Table) Execute

func (t *Table) Execute() (sql.Result, error)

Execute function

func (*Table) Rename

func (t *Table) Rename() RenameItem

type TableService

type TableService interface {
	Rename() RenameItem
	Add() AddNewColumn
	Execute() (sql.Result, error)
}

func NewTable

func NewTable(name string, db *sql.DB) TableService

NewTable constructor for the Table struct.

Jump to

Keyboard shortcuts

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