schema

package
v0.0.0-...-160aec1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2016 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SQLITE int = iota
	POSTGRES
	MYSQL
)
View Source
const (
	INTEGER int = iota
	VARCHAR
	BOOLEAN
	REAL
	BLOB
	JSON
)

List of basic types

View Source
const (
	AUTO_INCREMENT = iota
	PRIMARY_KEY
)

List of vendor-specific keywords

Variables

View Source
var Dialects = map[string]int{
	"sqlite":   SQLITE,
	"postgres": POSTGRES,
	"mysql":    MYSQL,
}

Functions

This section is empty.

Types

type Dialect

type Dialect interface {
	Table(*Table) string
	Index(*Table, *Index) string
	Column(*Field) string
	Insert(*Table) string
	Update(*Table, []*Field) string
	Delete(*Table, []*Field) string
	Select(*Table, []*Field) string
	SelectCount(*Table, []*Field) string
	SelectRange(*Table, []*Field) string
	Param(int) string
	Token(int) string
}

func New

func New(dialect int) Dialect

type Field

type Field struct {
	Name    string
	Type    int
	Primary bool
	Auto    bool
	Size    int
}

type Index

type Index struct {
	Name   string
	Unique bool

	Fields []*Field
}

type Table

type Table struct {
	Name         string
	LastInsertId bool

	Fields  []*Field
	Index   []*Index
	Primary []*Field
}

func Load

func Load(tree *parse.Node) *Table

Jump to

Keyboard shortcuts

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