schema

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 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 Builder

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

func NewBuilder

func NewBuilder(schemaBuilder StorageSchemaGenerator) *Builder

func (*Builder) Build

func (b *Builder) Build(registry *entity.MetaRegistry) (string, error)

type ColumnType

type ColumnType string
const (
	Bool  ColumnType = "bool"
	Int   ColumnType = "int"
	Int32 ColumnType = "int32"
	Int64 ColumnType = "int64"

	Float64 ColumnType = "float64"
	Float32 ColumnType = "float32"

	String ColumnType = "string"

	Time ColumnType = "time"

	UUID ColumnType = "uuid"

	NullBool  ColumnType = "null-bool"
	NullInt32 ColumnType = "null-int32"
	NullInt64 ColumnType = "null-int64"

	NullFloat64 ColumnType = "null-float64"

	NullString ColumnType = "null-string"

	NullTime ColumnType = "null-time"
)

type StorageSchemaGenerator

type StorageSchemaGenerator interface {
	CreateTableSql(name string, columns map[string]ColumnType, pkColumns []string, pkStrategy entity.PkStrategy) string
	CreateIndexSql(name string, unique bool, table string, columns ...string) string
}

Jump to

Keyboard shortcuts

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