Documentation
¶
Overview ¶
Package dibbi contains functions to manipulate a dibbi instance.
Index ¶
Constants ¶
View Source
const ( SelectType astType = iota CreateTableType InsertType )
View Source
const ( SelectKeyword keyword = "select" FromKeyword keyword = "from" AsKeyword keyword = "as" TableKeyword keyword = "table" CreateKeyword keyword = "create" InsertKeyword keyword = "insert" IntoKeyword keyword = "into" ValuesKeyword keyword = "values" IntKeyword keyword = "int" TextKeyword keyword = "text" BoolKeyword keyword = "bool" WhereKeyword keyword = "where" AndKeyword keyword = "and" OrKeyword keyword = "or" TrueKeyword keyword = "true" FalseKeyword keyword = "false" UniqueKeyword keyword = "unique" IndexKeyword keyword = "index" OnKeyword keyword = "on" PrimaryKeyKeyword keyword = "primary key" NullKeyword keyword = "null" LimitKeyword keyword = "limit" OffsetKeyword keyword = "offset" DropKeyword keyword = "drop" SemicolonSymbol symbol = ";" AsteriskSymbol symbol = "*" CommaSymbol symbol = "," LeftParenthesesSymbol symbol = "(" RightParenthesesSymbol symbol = ")" EqualsSymbol symbol = "=" NeqSymbol symbol = "<>" NeqSymbol2 symbol = "!=" ConcatSymbol symbol = "||" PlusSymbol symbol = "+" LtSymbol symbol = "<" LteSymbol symbol = "<=" GtSymbol symbol = ">" GteSymbol symbol = ">=" KeywordType tokenType = iota SymbolType IdentifierType StringType NumericType BooleanType NullType )
Variables ¶
Functions ¶
Types ¶
type ColumnType ¶
type ColumnType uint
ColumnType defines the available column types
const ( TextType ColumnType = iota IntType BoolType )
func (ColumnType) String ¶
func (c ColumnType) String() string
type Database ¶
type Database interface {
CreateTable(*createTableStatement) error
//DropTable(*dropTableStatement) error
//CreateIndex(*createIndexStatement) error
Insert(*InsertStatement) error
Select(*selectStatement) (*Results, error)
}
type ExpressionType ¶
type ExpressionType uint
const (
LiteralType ExpressionType = iota
)
func (ExpressionType) String ¶
func (lt ExpressionType) String() string
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
func NewMemoryBackend ¶
func NewMemoryBackend() *InMemoryBackend
func (*InMemoryBackend) CreateTable ¶
func (mb *InMemoryBackend) CreateTable(crt *createTableStatement) error
func (*InMemoryBackend) Insert ¶
func (mb *InMemoryBackend) Insert(inst *InsertStatement) error
func (*InMemoryBackend) Select ¶
func (mb *InMemoryBackend) Select(selectStatement *selectStatement) (*Results, error)
type InsertStatement ¶
type InsertStatement struct {
Table token
Values *[]*expression
}
func (*InsertStatement) String ¶
func (s *InsertStatement) String() string
type ResultColumn ¶
type ResultColumn struct {
Type ColumnType
Name string
NotNull bool
}
type Results ¶
type Results struct {
Columns []ResultColumn
Rows [][]Cell
}
type TableMetadata ¶
type TableMetadata struct {
Name string
Columns []ResultColumn
Indexes []Index
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.