schema

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: Apache-2.0, MIT Imports: 5 Imported by: 1

Documentation

Overview

TODO: Normalize implicit things in input first, and then compare

This package has SQL parser, its abstraction and SQL generator. Never touch database.

Index

Constants

View Source
const (
	ValueTypeStr = ValueType(iota)
	ValueTypeInt
	ValueTypeFloat
	ValueTypeHexNum
	ValueTypeHex
	ValueTypeValArg
	ValueTypeBit
)
View Source
const (
	ColumnKeyNone = ColumnKeyOption(iota)
	ColumnKeyPrimary
	ColumnKeySpatialKey
	ColumnKeyUnique
	ColumnKeyUniqueKey
	ColumnKey
)
View Source
const (
	GeneratorModeMysql = GeneratorMode(iota)
	GeneratorModePostgres
)

Variables

This section is empty.

Functions

func GenerateIdempotentDDLs

func GenerateIdempotentDDLs(mode GeneratorMode, desiredSQL string, currentSQL string) ([]string, error)

Parse argument DDLs and call `generateDDLs()`

Types

type AddForeignKey added in v0.4.0

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

func (*AddForeignKey) Statement added in v0.4.0

func (a *AddForeignKey) Statement() string

type AddIndex

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

func (*AddIndex) Statement

func (a *AddIndex) Statement() string

type AddPrimaryKey added in v0.3.3

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

func (*AddPrimaryKey) Statement added in v0.3.3

func (a *AddPrimaryKey) Statement() string

type Column

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

type ColumnKeyOption

type ColumnKeyOption int

type CreateIndex added in v0.2.0

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

func (*CreateIndex) Statement added in v0.2.0

func (c *CreateIndex) Statement() string

type CreateTable

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

func (*CreateTable) Statement

func (c *CreateTable) Statement() string

type DDL

type DDL interface {
	Statement() string
}

type ForeignKey added in v0.4.0

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

type Generator

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

This struct holds simulated schema states during GenerateIdempotentDDLs().

type GeneratorMode added in v0.2.0

type GeneratorMode int

type Index

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

type IndexColumn

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

type Table

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

type Value

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

type ValueType

type ValueType int

Jump to

Keyboard shortcuts

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