column

package
v0.0.0-...-ce57706 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2017 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

Package column contains schemas for the common columns you need to create using the schema package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BooleanColumn

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

BooleanColumn models a column with a boolean type.

func Boolean

func Boolean(name string) *BooleanColumn

Boolean creates a new boolean column.

func (*BooleanColumn) Nullable

func (col *BooleanColumn) Nullable() *BooleanColumn

Nullable allows the column to contain NULLs.

func (*BooleanColumn) SQL

func (col *BooleanColumn) SQL() string

SQL generates the SQL needed to create the column.

type DateColumn

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

DateColumn models a column with a date type.

func Date

func Date(name string) *DateColumn

Date creates a new date column.

func (*DateColumn) Nullable

func (col *DateColumn) Nullable() *DateColumn

Nullable allows the column to contain NULLs.

func (*DateColumn) SQL

func (col *DateColumn) SQL() string

SQL generates the SQL needed to create the column.

type DateTimeColumn

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

DateTimeColumn models a column with a datetime type.

func DateTime

func DateTime(name string) *DateTimeColumn

DateTime creates a new datetime column.

func (*DateTimeColumn) DefaultCurrent

func (col *DateTimeColumn) DefaultCurrent() *DateTimeColumn

DefaultCurrent sets the default value of the column to the current datetime.

func (*DateTimeColumn) Nullable

func (col *DateTimeColumn) Nullable() *DateTimeColumn

Nullable allows the column to contain NULLs.

func (*DateTimeColumn) SQL

func (col *DateTimeColumn) SQL() string

SQL generates the SQL needed to create the column.

type DecimalColumn

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

DecimalColumn models a column with a decimal type.

func Decimal

func Decimal(name string, length, decimalPositions int) *DecimalColumn

Decimal creates a new decimal column.

func (*DecimalColumn) Nullable

func (col *DecimalColumn) Nullable() *DecimalColumn

Nullable allows the column to contain NULLs.

func (*DecimalColumn) SQL

func (col *DecimalColumn) SQL() string

SQL generates the SQL needed to create the column.

type IntegerColumn

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

IntegerColumn models a column with a integer type.

func AutoIncrement

func AutoIncrement() *IntegerColumn

AutoIncrement creates a new integer column that autoincrements and it's the primary key of the table.

func Integer

func Integer(name string, length int) *IntegerColumn

Integer creates a new integer column.

func (*IntegerColumn) After

func (col *IntegerColumn) After(name string) *IntegerColumn

After sets the column next to the one we're inserting as a reference point for the update/create column.

func (*IntegerColumn) AutoIncrement

func (col *IntegerColumn) AutoIncrement() *IntegerColumn

AutoIncrement flags the column with a default value that increments in each row inserted.

func (*IntegerColumn) First

func (col *IntegerColumn) First() *IntegerColumn

First sets the column first in the table.

func (*IntegerColumn) Nullable

func (col *IntegerColumn) Nullable() *IntegerColumn

Nullable allows the column to contain NULLs.

func (*IntegerColumn) PrimaryKey

func (col *IntegerColumn) PrimaryKey() *IntegerColumn

PrimaryKey flags the column as the primary key of the table.

func (*IntegerColumn) SQL

func (col *IntegerColumn) SQL() string

SQL generates the SQL needed to create the column.

type LongBlobColumn

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

LongBlobColumn models a column with a large binary type.

func LongBlob

func LongBlob(name string) *LongBlobColumn

LongBlob creates a new large binary column.

func (*LongBlobColumn) Nullable

func (col *LongBlobColumn) Nullable() *LongBlobColumn

Nullable allows the column to contain NULLs.

func (*LongBlobColumn) SQL

func (col *LongBlobColumn) SQL() string

SQL generates the SQL needed to create the column.

type LongTextColumn

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

LongTextColumn models a column with a large ASCII text type.

func LongText

func LongText(name string) *LongTextColumn

LongText creates a new large ASCII text column.

func (*LongTextColumn) Nullable

func (col *LongTextColumn) Nullable() *LongTextColumn

Nullable allows the column to contain NULLs.

func (*LongTextColumn) SQL

func (col *LongTextColumn) SQL() string

SQL generates the SQL needed to create the column.

type StringColumn

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

StringColumn models a column with a string type.

func String

func String(name string, length int) *StringColumn

String creates a new string column.

func (*StringColumn) After

func (col *StringColumn) After(name string) *StringColumn

After sets the column next to the one we're inserting as a reference point for the update/create column.

func (*StringColumn) Nullable

func (col *StringColumn) Nullable() *StringColumn

Nullable allows the column to contain NULLs.

func (*StringColumn) PrimaryKey

func (col *StringColumn) PrimaryKey() *StringColumn

PrimaryKey flags the column as the primary key of the table.

func (*StringColumn) SQL

func (col *StringColumn) SQL() string

SQL generates the SQL needed to create the column.

type TextColumn

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

TextColumn models a column with a text type.

func Text

func Text(name string) *TextColumn

Text creates a new text column.

func (*TextColumn) Nullable

func (col *TextColumn) Nullable() *TextColumn

Nullable allows the column to contain NULLs.

func (*TextColumn) SQL

func (col *TextColumn) SQL() string

SQL generates the SQL needed to create the column.

Jump to

Keyboard shortcuts

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