Documentation
¶
Index ¶
- Constants
- Variables
- func WithAlterTableAddColumn(column *Column) func(*AlterTable)
- func WithAlterTableDropColumn(column *Column) func(*AlterTable)
- func WithAlterTableRenameColumn(from *Column, to *Column) func(*AlterTable)
- func WithAlterTableRenameTo(tbl *Table) func(*AlterTable)
- func WithAlterTableSchema(name string) func(*AlterTable)
- func WithColumnData(data *DataDef) func(*Column)
- func WithColumnLiteral(l *Literal) func(*Column)
- func WithColumnName(name string) func(*Column)
- func WithLiteralType(t LiteralType) func(*Literal)
- func WithSchemaColumns(columns ColumnList) func(*Schema)
- func WithSchemaIndexes(idxes IndexList) func(*Schema)
- func WithSelectLimit(offset int, limit int) func(*Select)
- func WithSelectOrderBy(name string, order Order) func(*Select)
- type AlterDatabase
- type AlterTable
- func (stmt *AlterTable) AddColum() (*Column, bool)
- func (stmt *AlterTable) DropColum() (*Column, bool)
- func (stmt *AlterTable) RenameColums() (*Column, *Column, bool)
- func (stmt *AlterTable) RenameTable() (*Table, bool)
- func (stmt *AlterTable) StatementType() StatementType
- func (stmt *AlterTable) String() string
- type AlterTableOption
- type AndExpr
- type BindParam
- type BindParams
- type CmpExpr
- type CmpExprOperator
- type Column
- type ColumnList
- func (columns ColumnList) ColumnAt(n int) (*Column, error)
- func (columns ColumnList) ColumnByName(name string) (*Column, error)
- func (columns ColumnList) Columns() ColumnList
- func (columns ColumnList) Copy() ColumnList
- func (columns ColumnList) DefString() string
- func (columns ColumnList) IsSelectAll() bool
- func (columns ColumnList) NameString() string
- func (columns ColumnList) Names() []string
- func (columns ColumnList) SetSchema(schema *Schema) error
- func (columns ColumnList) ValueString() string
- type ColumnOption
- type Commit
- type Condition
- type Copy
- type CreateDatabase
- type CreateIndex
- type CreateTable
- type DataDef
- type DataType
- type Database
- type Delete
- type DropDatabase
- type DropIndex
- type DropTable
- type Expr
- type IfExistsOpt
- type IfNotExistsOpt
- type Index
- type IndexList
- type IndexType
- type Insert
- type Limit
- type Literal
- type LiteralOption
- type LiteralType
- type OrExpr
- type Order
- type OrderBy
- func (orderBy *OrderBy) Column() string
- func (orderBy *OrderBy) IsAsc() bool
- func (orderBy *OrderBy) IsDesc() bool
- func (orderBy *OrderBy) IsNone() bool
- func (orderBy *OrderBy) Order() Order
- func (orderBy *OrderBy) SetColumn(name string) *OrderBy
- func (orderBy *OrderBy) SetOrder(order Order) *OrderBy
- func (orderBy *OrderBy) String() string
- type Schema
- type SchemaOption
- type Select
- type SelectOption
- type Statement
- type StatementList
- type StatementType
- type Table
- type TableList
- type Truncate
- type Update
- type Vacuum
Constants ¶
const ( UnknownData = iota BigIntData BinaryData BitData BlobData BooleanData CharData CharacterData ClobData DateData DecimalData DoubleData FloatData IntData IntegerData LongBlobData LongTextData MediumBlobData MediumIntData MediumTextData NumericData RealData SetData SmallIntData TextData TimeData TimeStampData TinyBlobData TinyIntData TinyTextData VarBinaryData VarCharData VarCharacterData YearData )
const ( BoolObjectId = 16 ByteaObjectId = 17 CharObjectId = 18 NameObjectId = 19 Int8ObjectId = 20 Int2ObjectId = 21 Int2VectorObjectId = 22 Int4ObjectId = 23 RegProcObjectId = 24 TextObjectId = 25 OidObjectId = 26 TidObjectId = 27 XidObjectId = 28 CidObjectId = 29 XmlObjectId = 142 PointObjectId = 600 LsegObjectId = 601 PathObjectId = 602 BoxObjectId = 603 PolygonObjectId = 604 LineObjectId = 628 LineArrayObjectId = 629 CircleObjectId = 718 CircleArrayObjectId = 719 MacaddrObjectId = 829 Macaddr8ObjectId = 774 InetObjectId = 869 InetArrayObjectId = 1040 CidrObjectId = 650 CidrArrayObjectId = 651 Float4ObjectId = 700 Float8ObjectId = 701 UnknownObjectId = 705 AbstimeObjectId = 702 ReltimeObjectId = 703 TintervalObjectId = 704 PolygonArrayObjectId = 628 OidvectorObjectId = 30 BpcharObjectId = 1042 VarcharObjectId = 1043 DateObjectId = 1082 TimeObjectId = 1083 TimestampObjectId = 1114 TimestampTzObjectId = 1184 IntervalObjectId = 1186 TimeTzObjectId = 1266 BitObjectId = 1560 VarbitObjectId = 1562 NumericObjectId = 1700 RefcursorObjectId = 1790 RegprocedureObjectId = 2202 RegoperObjectId = 2203 RegoperatorObjectId = 2204 RegclassObjectId = 2205 RegtypeObjectId = 2206 RecordObjectId = 2249 CstringObjectId = 2275 AnyObjectId = 2276 AnyarrayObjectId = 2277 VoidObjectId = 2278 TriggerObjectId = 2279 LanguageHandlerObjectId = 2280 InternalObjectId = 2281 OpaqueObjectId = 2282 AnyelementObjectId = 2283 AnynonarrayObjectId = 2776 GeometryObjectId = 3614 GeograpyObjectId = 4326 )
const ( UnknownLiteral = iota StringLiteral )
const ( CreateDatabaseStatement = iota CreateTableStatement CreateIndexStatement InsertStatement SelectStatement UpdateStatement DeleteStatement DropDatabaseStatement DropTableStatement DropIndexStatement AlterDatabaseStatement AlterTableStatement AlterIndexStatement CopyStatement CommitStatement VacuumStatement TruncateStatement )
const (
// Asterisk is a asterisk string.
Asterisk = "*"
)
Variables ¶
var ErrInvalidDataType = errors.New("invalid data type")
ErrInvalidDataType is returned when the data type is invalid.
var ErrNotFound = errors.New("not found")
ErrNotFound is returned when the data type is invalid.
var NullLiteral = NewLiteralWith(nil)
NullLiteral represents a null value.
Functions ¶
func WithAlterTableAddColumn ¶ added in v0.9.2
func WithAlterTableAddColumn(column *Column) func(*AlterTable)
WithAlterTableAddColumn sets an add column.
func WithAlterTableDropColumn ¶ added in v0.9.2
func WithAlterTableDropColumn(column *Column) func(*AlterTable)
WithAlterTableDropColumn sets a drop column.
func WithAlterTableRenameColumn ¶ added in v0.9.2
func WithAlterTableRenameColumn(from *Column, to *Column) func(*AlterTable)
WithAlterTableRenameColumn sets a rename column.
func WithAlterTableRenameTo ¶ added in v0.9.2
func WithAlterTableRenameTo(tbl *Table) func(*AlterTable)
WithAlterTableRenameTo sets a rename table.
func WithAlterTableSchema ¶ added in v0.9.2
func WithAlterTableSchema(name string) func(*AlterTable)
WithAlterTableSchema sets a schema.
func WithColumnData ¶ added in v0.9.1
WithColumnData sets a column data.
func WithColumnLiteral ¶ added in v0.9.1
WithColumnLiteral sets a column data.
func WithColumnName ¶ added in v0.9.1
WithColumnName sets a column name.
func WithLiteralType ¶ added in v0.9.1
func WithLiteralType(t LiteralType) func(*Literal)
WithSchemaColumns returns a schema option to set the columns.
func WithSchemaColumns ¶ added in v0.9.1
func WithSchemaColumns(columns ColumnList) func(*Schema)
WithSchemaColumns returns a schema option to set the columns.
func WithSchemaIndexes ¶ added in v0.9.1
WithSchemaIndexes returns a schema option to set the indexes.
func WithSelectLimit ¶ added in v1.0.0
WithSelectLimit sets order by options.
func WithSelectOrderBy ¶ added in v1.0.0
WithSelectOrderBy sets order by options.
Types ¶
type AlterDatabase ¶
type AlterDatabase struct { *Database // contains filtered or unexported fields }
AlterDatabase is a "ALTER DATABASE" statement.
func NewAlterDatabaseWith ¶
func NewAlterDatabaseWith(name string, to string) *AlterDatabase
NewAlterDatabaseWith returns a new AlterDatabase statement instance with the specified options.
func (*AlterDatabase) RenameTo ¶ added in v0.9.2
func (stmt *AlterDatabase) RenameTo() *Database
RenameTo returns the "TO" database.
func (*AlterDatabase) StatementType ¶
func (stmt *AlterDatabase) StatementType() StatementType
StatementType returns the statement type.
func (*AlterDatabase) String ¶
func (stmt *AlterDatabase) String() string
String returns the statement string representation.
type AlterTable ¶
AlterTable is a "ALTER TABLE" statement.
func NewAlterTableWith ¶
func NewAlterTableWith(tblName string, opts ...AlterTableOption) *AlterTable
NewAlterTableWith returns a new AlterTable statement instance with the specified options.
func (*AlterTable) AddColum ¶ added in v0.9.2
func (stmt *AlterTable) AddColum() (*Column, bool)
AddColum returns the add column.
func (*AlterTable) DropColum ¶ added in v0.9.2
func (stmt *AlterTable) DropColum() (*Column, bool)
DropColum returns the drop column.
func (*AlterTable) RenameColums ¶ added in v0.9.2
func (stmt *AlterTable) RenameColums() (*Column, *Column, bool)
RenameColums returns the rename columns.
func (*AlterTable) RenameTable ¶ added in v0.9.2
func (stmt *AlterTable) RenameTable() (*Table, bool)
RenameTable returns the rename table.
func (*AlterTable) StatementType ¶
func (stmt *AlterTable) StatementType() StatementType
StatementType returns the statement type.
func (*AlterTable) String ¶
func (stmt *AlterTable) String() string
String returns the statement string representation.
type AlterTableOption ¶ added in v0.9.2
type AlterTableOption = func(*AlterTable)
AlterTableOption represents an alter table option function.
type BindParam ¶ added in v0.9.1
type BindParam struct {
// contains filtered or unexported fields
}
BindParam represents a bind param.
func NewBindParamWith ¶ added in v0.9.1
NewBindParam returns a bind param instance.
type BindParams ¶ added in v0.9.1
type BindParams []*BindParam
BindParams represens a bind param array.
func NewBindParams ¶ added in v0.9.1
func NewBindParams() BindParams
NewBindParams returns a bind param array instance.
type CmpExpr ¶ added in v0.9.1
type CmpExpr struct {
// contains filtered or unexported fields
}
CmpExpr represents an comparsion expression.
func NewCmpExpr ¶ added in v0.9.1
func NewCmpExpr(op CmpExprOperator, left *Column, right *Literal) *CmpExpr
NewCmpExpr returns a new CompExpr instance with the specified parameters.
func (*CmpExpr) Operator ¶ added in v0.9.1
func (expr *CmpExpr) Operator() CmpExprOperator
Operator returns the operator.
type CmpExprOperator ¶ added in v0.9.1
type CmpExprOperator uint8
CmpExprOperator is an enum for CompExpr.Operator
const ( EQ CmpExprOperator = iota NEQ LT GT LE GE IN NIN )
Constants for Enum Type - CompExprOperator
func (CmpExprOperator) String ¶ added in v0.9.1
func (t CmpExprOperator) String() string
String returns the string representation.
type Column ¶
Column represents a column.
func NewColumnWithName ¶
NewColumn returns a column instance.
func NewColumnWithOptions ¶ added in v0.9.1
func NewColumnWithOptions(opts ...ColumnOption) *Column
NewColumn returns a column instance.
func (*Column) IsName ¶ added in v0.9.1
IsName returns true whether the column name is the specified one.
func (*Column) SetDef ¶ added in v0.9.1
SetDef sets the column definition to update the column value.
type ColumnList ¶ added in v0.9.1
type ColumnList []*Column
ColumnList represens a column array.
func NewColumnsWith ¶
func NewColumnsWith(columns ...*Column) ColumnList
NewColumnsWith returns a column array instance with the specified columns.
func (ColumnList) ColumnAt ¶ added in v0.9.2
func (columns ColumnList) ColumnAt(n int) (*Column, error)
ColumnAt returns a column by the specified index.
func (ColumnList) ColumnByName ¶ added in v0.9.1
func (columns ColumnList) ColumnByName(name string) (*Column, error)
ColumnByName returns a column by the specified name.
func (ColumnList) Columns ¶ added in v0.9.1
func (columns ColumnList) Columns() ColumnList
Column returns a column array.
func (ColumnList) Copy ¶ added in v0.9.2
func (columns ColumnList) Copy() ColumnList
Copy returns a copy of the column list.
func (ColumnList) DefString ¶ added in v0.9.1
func (columns ColumnList) DefString() string
DefString returns a string representation of the the colum definitions.
func (ColumnList) IsSelectAll ¶ added in v0.9.1
func (columns ColumnList) IsSelectAll() bool
IsSelectAll returns true if the column list is "*".
func (ColumnList) NameString ¶ added in v0.9.1
func (columns ColumnList) NameString() string
NameString returns a string representation of the the colum names.
func (ColumnList) Names ¶ added in v0.9.1
func (columns ColumnList) Names() []string
Names returns a column name array.
func (ColumnList) SetSchema ¶ added in v0.9.1
func (columns ColumnList) SetSchema(schema *Schema) error
SetSchema sets a schema to update column values.
func (ColumnList) ValueString ¶ added in v0.9.1
func (columns ColumnList) ValueString() string
ValueString returns a string representation of the the colum values.
type ColumnOption ¶ added in v0.9.1
type ColumnOption = func(*Column)
ColumnOption represents a column option function.
type Commit ¶ added in v0.9.2
type Commit struct { }
Commit is a "COMMIT" statement.
func NewCommit ¶ added in v0.9.2
func NewCommit() *Commit
NewCommitWith returns a new Commit statement instance with the specified parameters.
func (*Commit) StatementType ¶ added in v0.9.2
func (stmt *Commit) StatementType() StatementType
StatementType returns the statement type.
type Condition ¶ added in v0.9.1
type Condition struct {
// contains filtered or unexported fields
}
Condition represents a where condition.
func NewConditionWith ¶ added in v0.9.1
NewConditionWith returns a new where condition instance with the specified parameters.
type Copy ¶ added in v0.9.2
type Copy struct { *Table // contains filtered or unexported fields }
Copy is a "COPY" statement.
func NewCopyWith ¶ added in v0.9.2
NewCopyWith returns a new Copy statement instance with the specified parameters.
func (*Copy) StatementType ¶ added in v0.9.2
func (stmt *Copy) StatementType() StatementType
StatementType returns the statement type.
type CreateDatabase ¶
type CreateDatabase struct { *Database *IfNotExistsOpt }
CreateDatabase is a "CREATE DATABASE" statement.
func NewCreateDatabaseWith ¶
func NewCreateDatabaseWith(name string, ifne *IfNotExistsOpt) *CreateDatabase
NewCreateDatabaseWith returns a new CreateDatabase statement instance with the specified options.
func (*CreateDatabase) StatementType ¶
func (stmt *CreateDatabase) StatementType() StatementType
StatementType returns the statement type.
func (*CreateDatabase) String ¶
func (stmt *CreateDatabase) String() string
String returns the statement string representation.
type CreateIndex ¶
type CreateIndex struct { *Schema *IfNotExistsOpt }
CreateIndex is a "CREATE INDEX" statement.
func NewCreateIndexWith ¶
func NewCreateIndexWith(schema *Schema, ifne *IfNotExistsOpt) *CreateIndex
NewCreateIndexWith returns a new CreateIndex statement instance with the specified parameters.
func (*CreateIndex) StatementType ¶
func (stmt *CreateIndex) StatementType() StatementType
StatementType returns the statement type.
func (*CreateIndex) String ¶
func (stmt *CreateIndex) String() string
String returns the statement string representation.
type CreateTable ¶
type CreateTable struct { *IfNotExistsOpt // contains filtered or unexported fields }
CreateTable is a "CREATE TABLE" statement.
func NewCreateTableWith ¶
func NewCreateTableWith(schema *Schema, ifne *IfNotExistsOpt) *CreateTable
NewCreateTableWith returns a new CreateTable statement instance with the specified options.
func (*CreateTable) Schema ¶ added in v0.9.1
func (stmt *CreateTable) Schema() *Schema
Schema returns the schema.
func (*CreateTable) StatementType ¶
func (stmt *CreateTable) StatementType() StatementType
StatementType returns the statement type.
func (*CreateTable) String ¶
func (stmt *CreateTable) String() string
String returns the statement string representation.
func (*CreateTable) TableName ¶ added in v0.9.1
func (stmt *CreateTable) TableName() string
TableName returns the table name.
type DataDef ¶ added in v0.9.1
DataDef represents a data definition.
func NewDataFrom ¶
NewDataFrom returns the data type of the specified string.
func NewDataWith ¶
NewDataWith returns a new DataType instance with the specified type and length.
func (*DataDef) DataLength ¶ added in v0.9.1
DataLength returns the column data length.
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database represents a database.
func NewDatabaseWith ¶
NewDatabaseWith returns a new Database instance with the specified name.
func (*Database) DatabaseName ¶ added in v0.9.1
DatabaseName returns the database name.
type Delete ¶
type Delete struct { *Condition // contains filtered or unexported fields }
Delete is a "DELETE" statement.
func NewDeleteWith ¶
NewDeleteWith returns a new Delete statement instance with the specified parameters.
func (*Delete) StatementType ¶
func (stmt *Delete) StatementType() StatementType
StatementType returns the statement type.
type DropDatabase ¶
type DropDatabase struct { *Database *IfExistsOpt }
DropDatabase is a "DROP DATABASE" statement.
func NewDropDatabaseWith ¶
func NewDropDatabaseWith(name string, ife *IfExistsOpt) *DropDatabase
NewDropDatabaseWith returns a new DropDatabase statement instance with the specified parameters.
func (*DropDatabase) StatementType ¶
func (stmt *DropDatabase) StatementType() StatementType
StatementType returns the statement type.
func (*DropDatabase) String ¶
func (stmt *DropDatabase) String() string
String returns the statement string representation.
type DropIndex ¶
type DropIndex struct { *Index *Schema *IfExistsOpt }
DropIndex is a "DROP INDEX" statement.
func NewDropIndexWith ¶
func NewDropIndexWith(schemaName string, idxName string, ife *IfExistsOpt) *DropIndex
NewDropIndexWith returns a new DropIndex statement instance with the specified parameters.
func (*DropIndex) StatementType ¶
func (stmt *DropIndex) StatementType() StatementType
StatementType returns the statement type.
type DropTable ¶
type DropTable struct { TableList *IfExistsOpt }
DropTable is a "DROP TABLE" statement.
func NewDropTableWith ¶
func NewDropTableWith(tbls TableList, ife *IfExistsOpt) *DropTable
NewDropTableWith returns a new DropTable statement instance with the specified parameters.
func (*DropTable) StatementType ¶
func (stmt *DropTable) StatementType() StatementType
StatementType returns the statement type.
type Expr ¶
type Expr interface { // String returns the index string representation. String() string }
Expr represents an expression.
type IfExistsOpt ¶ added in v0.9.1
type IfExistsOpt struct {
// contains filtered or unexported fields
}
IfExistsOpt represents a IF EXISTS option.
func NewIfExistsWith ¶
func NewIfExistsWith(v bool) *IfExistsOpt
NewIfExistsWith returns a new IfExists option instance.
func (*IfExistsOpt) IfExists ¶ added in v0.9.1
func (opt *IfExistsOpt) IfExists() bool
IfExists returns the IF EXISTS option.
func (*IfExistsOpt) String ¶ added in v0.9.1
func (opt *IfExistsOpt) String() string
String returns the string representation.
type IfNotExistsOpt ¶ added in v0.9.1
type IfNotExistsOpt struct {
// contains filtered or unexported fields
}
IfNotExistsOpt represents a IF NOT EXISTS option.
func NewIfNotExistsWith ¶
func NewIfNotExistsWith(v bool) *IfNotExistsOpt
NewIfNotExistsWith returns a new IfNotExists option instance.
func (*IfNotExistsOpt) IfNotExists ¶ added in v0.9.1
func (opt *IfNotExistsOpt) IfNotExists() bool
IfNotExists returns the IF NOT EXISTS option.
func (*IfNotExistsOpt) String ¶ added in v0.9.1
func (opt *IfNotExistsOpt) String() string
String returns the string representation.
type Index ¶
type Index struct { ColumnList // contains filtered or unexported fields }
Index represents a index.
func NewIndexWith ¶
func NewIndexWith(name string, t IndexType, columns ColumnList) *Index
NewIndexWith returns a new index instance.
func NewPrimaryIndexWith ¶
func NewPrimaryIndexWith(columns ColumnList) *Index
NewPrimaryIndexWith returns a new primary index instance.
func NewSecondaryIndexWith ¶
func NewSecondaryIndexWith(name string, columns ColumnList) *Index
NewSecondaryIndexWith returns a new secondary index instance.
type IndexList ¶ added in v0.9.1
type IndexList []*Index
IndexList represents an index array.
type Insert ¶
type Insert struct { *Table ColumnList }
Insert is a "INSERT" statement.
func NewInsertWith ¶
func NewInsertWith(tbl *Table, columns ColumnList) *Insert
NewInsertWith returns a new Insert statement instance with the specified parameters.
func (*Insert) StatementType ¶
func (stmt *Insert) StatementType() StatementType
StatementType returns the statement type.
type Limit ¶ added in v1.0.0
type Limit struct {
// contains filtered or unexported fields
}
Limit represents a LIMIT clause.
func NewLimitWith ¶ added in v1.0.0
NewLimitWith returns a new Limit instance with the specified offset and limit.
type Literal ¶
type Literal struct {
// contains filtered or unexported fields
}
Literal represents a constant value.
func NewLiteralWith ¶
func NewLiteralWith(v any, opts ...LiteralOption) *Literal
NewLiteralWith returns a new Literal instance with the specified value.
func (*Literal) SetType ¶ added in v0.9.1
func (lit *Literal) SetType(t LiteralType) *Literal
SetType sets a type.
func (*Literal) ValueString ¶ added in v0.9.1
ValueString returns the string representation.
func (*Literal) ValueType ¶ added in v0.9.1
func (lit *Literal) ValueType() LiteralType
ValueType returns the literal type.
type LiteralOption ¶ added in v0.9.1
type LiteralOption = func(*Literal)
LiteralOption represents a literal option function.
type OrderBy ¶ added in v1.0.0
type OrderBy struct {
// contains filtered or unexported fields
}
OrderBy represents an ORDER BY clause.
func NewOrderBy ¶ added in v1.0.0
func NewOrderBy() *OrderBy
NewOrderBy returns a new OrderBy instance.
func NewOrderByWith ¶ added in v1.0.0
type Schema ¶
type Schema struct { *Table ColumnList IndexList }
Schema represents a table schema.
func NewSchemaWith ¶
func NewSchemaWith(name string, opts ...SchemaOption) *Schema
NewSchemaWith returns a new schema statement instance with the parameters.
func (*Schema) SchemaName ¶ added in v0.9.1
SchemaName returns the table name.
func (*Schema) SchemaTable ¶ added in v0.9.2
SchemaTable returns the table.
type SchemaOption ¶ added in v0.9.1
type SchemaOption = func(*Schema)
SchemaOption represents a schema option function.
type Select ¶
type Select struct { TableList ColumnList *Condition // contains filtered or unexported fields }
Select is a "SELECT" statement.
func NewSelectWith ¶
func NewSelectWith(columns ColumnList, tbls TableList, w *Condition, opts ...SelectOption) *Select
NewSelectWith returns a new Select statement instance with the specified parameters.
func (*Select) StatementType ¶
func (stmt *Select) StatementType() StatementType
StatementType returns the statement type.
type SelectOption ¶ added in v1.0.0
type SelectOption = func(*Select)
SelectOption represents a select option function.
type Statement ¶
type Statement interface { // StatementType returns the statement type. StatementType() StatementType // String returns the statement string representation. String() string }
Statement represents a statement interface.
type StatementList ¶
type StatementList = []Statement
StatementList represents a statement list.
func NewStatementList ¶
func NewStatementList() StatementList
NewStatementList returns a new statement list.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table represents a table.
func NewTableWith ¶
NewTableWith returns a new Table instance with the specified name.
type TableList ¶ added in v0.9.1
type TableList []*Table
TableList represens a column array.
func NewTablesWith ¶
NewTablesWith returns a column array instance with the specified columns.
type Truncate ¶ added in v0.9.2
type Truncate struct {
TableList
}
Truncate is a "TRUNCATE" statement.
func NewTruncateWith ¶ added in v0.9.2
NewTruncateWith returns a new truncate statement instance with the specified parameters.
func (*Truncate) StatementType ¶ added in v0.9.2
func (stmt *Truncate) StatementType() StatementType
StatementType returns the statement type.
type Update ¶
type Update struct { ColumnList *Condition // contains filtered or unexported fields }
Update is a "UPDATE" statement.
func NewUpdateWith ¶
func NewUpdateWith(tbl *Table, columns ColumnList, w *Condition) *Update
NewUpdateWith returns a new Update statement instance with the specified parameters.
func (*Update) StatementType ¶
func (stmt *Update) StatementType() StatementType
StatementType returns the statement type.
type Vacuum ¶ added in v0.9.2
type Vacuum struct {
*Table
}
Vacuum is a "VACUUM" statement.
func NewVacuum ¶ added in v0.9.2
func NewVacuum() *Vacuum
NewVacuum returns a new vacuum statement instance.
func NewVacuumWith ¶ added in v0.9.2
NewVacuumWith returns a new vacuum statement instance with the specified parameters.
func (*Vacuum) StatementType ¶ added in v0.9.2
func (stmt *Vacuum) StatementType() StatementType
StatementType returns the statement type.
Source Files
¶
- alter_database.go
- alter_table.go
- bind.go
- column.go
- columns.go
- commit.go
- const.go
- copy.go
- create_database.go
- create_index.go
- create_table.go
- data.go
- database.go
- delete.go
- drop_database.go
- drop_index.go
- drop_table.go
- errors.go
- expr.go
- expr_cmp.go
- index.go
- indexes.go
- insert.go
- limit.go
- literal.go
- options.go
- order.go
- schema.go
- select.go
- statement.go
- statement_type.go
- table.go
- tables.go
- truncate.go
- update.go
- vacuum.go
- where.go