craetetable

package
v0.16.6 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: MIT Imports: 7 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 {
	*Table
}

func CreateTable

func CreateTable(name string, cb func(t *Table)) *Builder

func FromStruct added in v0.16.5

func FromStruct(m models.Model) *Builder

func (*Builder) AddColumns

func (b *Builder) AddColumns(columns ...*ColumnBuilder) *Builder

func (*Builder) Columns

func (b *Builder) Columns(columns ...*ColumnBuilder) *Builder

func (*Builder) ToSQL

func (b *Builder) ToSQL(d dialects.Dialect) (string, []any, error)

type ColumnBuilder

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

func NewColumn

func NewColumn(name string, datatype dialects.DataType) *ColumnBuilder

func (*ColumnBuilder) NotNullable added in v0.16.5

func (b *ColumnBuilder) NotNullable() *ColumnBuilder

func (*ColumnBuilder) Nullable added in v0.16.5

func (b *ColumnBuilder) Nullable() *ColumnBuilder

func (*ColumnBuilder) ToSQL

func (b *ColumnBuilder) ToSQL(d dialects.Dialect) (string, []any, error)

type ForeignKeyBuilder added in v0.16.5

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

func (*ForeignKeyBuilder) ToSQL added in v0.16.5

func (b *ForeignKeyBuilder) ToSQL(d dialects.Dialect) (string, []any, error)

type IndexBuilder added in v0.16.5

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

func (*IndexBuilder) AddColumn added in v0.16.5

func (b *IndexBuilder) AddColumn(c string) *IndexBuilder

func (*IndexBuilder) ToSQL added in v0.16.5

func (b *IndexBuilder) ToSQL(d dialects.Dialect) (string, []any, error)

type Table

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

func (*Table) Bool added in v0.16.5

func (t *Table) Bool(name string) *ColumnBuilder

func (*Table) Float

func (t *Table) Float(name string) *ColumnBuilder

func (*Table) ForeignKey added in v0.16.5

func (t *Table) ForeignKey(localKey, relatedTable, relatedKey string)

func (*Table) Index added in v0.16.5

func (t *Table) Index(name string) *IndexBuilder

func (*Table) Int

func (t *Table) Int(name string) *ColumnBuilder

func (*Table) JSON added in v0.16.5

func (t *Table) JSON(name string) *ColumnBuilder

func (*Table) OfType added in v0.16.5

func (t *Table) OfType(datatype dialects.DataType, name string) *ColumnBuilder

func (*Table) String

func (t *Table) String(name string) *ColumnBuilder

func (*Table) UInt added in v0.16.5

func (t *Table) UInt(name string) *ColumnBuilder

Jump to

Keyboard shortcuts

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