Documentation
¶
Index ¶
- type AlterStmt
- type AlterTableAddField
- type Context
- type CreateIndexStmt
- type CreateSequenceStmt
- type CreateTableStmt
- type DeleteStmt
- type DropIndexStmt
- type DropSequenceStmt
- type DropTableStmt
- type ExplainStmt
- type InsertStmt
- type PreparedStreamStmt
- type Preparer
- type ReIndexStmt
- type Result
- type SelectCoreStmt
- type SelectStmt
- type Statement
- type StreamStmt
- type StreamStmtIterator
- type UpdateSetPair
- type UpdateStmt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlterStmt ¶
AlterStmt is a DSL that allows creating a full ALTER TABLE query.
func (AlterStmt) IsReadOnly ¶
IsReadOnly always returns false. It implements the Statement interface.
type AlterTableAddField ¶
func (AlterTableAddField) IsReadOnly ¶
func (stmt AlterTableAddField) IsReadOnly() bool
IsReadOnly always returns false. It implements the Statement interface.
type Context ¶
type Context struct { DB *database.Database Tx *database.Transaction Catalog *database.Catalog Params []environment.Param }
type CreateIndexStmt ¶
CreateIndexStmt represents a parsed CREATE INDEX statement.
func (*CreateIndexStmt) IsReadOnly ¶
func (stmt *CreateIndexStmt) IsReadOnly() bool
IsReadOnly always returns false. It implements the Statement interface.
type CreateSequenceStmt ¶
type CreateSequenceStmt struct { IfNotExists bool Info database.SequenceInfo }
CreateSequenceStmt represents a parsed CREATE SEQUENCE statement.
func (*CreateSequenceStmt) IsReadOnly ¶
func (stmt *CreateSequenceStmt) IsReadOnly() bool
IsReadOnly always returns false. It implements the Statement interface.
type CreateTableStmt ¶
CreateTableStmt represents a parsed CREATE TABLE statement.
func (*CreateTableStmt) IsReadOnly ¶
func (stmt *CreateTableStmt) IsReadOnly() bool
IsReadOnly always returns false. It implements the Statement interface.
type DeleteStmt ¶
type DeleteStmt struct { TableName string WhereExpr expr.Expr OffsetExpr expr.Expr OrderBy expr.Path LimitExpr expr.Expr OrderByDirection scanner.Token // contains filtered or unexported fields }
DeleteConfig holds DELETE configuration.
func NewDeleteStatement ¶ added in v0.14.0
func NewDeleteStatement() *DeleteStmt
func (*DeleteStmt) IsReadOnly ¶ added in v0.14.0
func (stmt *DeleteStmt) IsReadOnly() bool
type DropIndexStmt ¶
DropIndexStmt is a DSL that allows creating a DROP INDEX query.
func (DropIndexStmt) IsReadOnly ¶
func (stmt DropIndexStmt) IsReadOnly() bool
IsReadOnly always returns false. It implements the Statement interface.
type DropSequenceStmt ¶
DropSequenceStmt is a DSL that allows creating a DROP INDEX query.
func (DropSequenceStmt) IsReadOnly ¶
func (stmt DropSequenceStmt) IsReadOnly() bool
IsReadOnly always returns false. It implements the Statement interface.
type DropTableStmt ¶
DropTableStmt is a DSL that allows creating a DROP TABLE query.
func (DropTableStmt) IsReadOnly ¶
func (stmt DropTableStmt) IsReadOnly() bool
IsReadOnly always returns false. It implements the Statement interface.
type ExplainStmt ¶
type ExplainStmt struct {
Statement Preparer
}
ExplainStmt is a Statement that displays information about how a statement is going to be executed, without executing it.
func (*ExplainStmt) IsReadOnly ¶
func (s *ExplainStmt) IsReadOnly() bool
IsReadOnly indicates that this statement doesn't write anything into the database.
func (*ExplainStmt) Run ¶
func (stmt *ExplainStmt) Run(ctx *Context) (Result, error)
Run analyses the inner statement and displays its execution plan. If the statement is a stream, Optimize will be called prior to displaying all the operations. Explain currently only works on SELECT, UPDATE, INSERT and DELETE statements.
type InsertStmt ¶
type InsertStmt struct { TableName string Values []expr.Expr Fields []string SelectStmt Preparer Returning []expr.Expr OnConflict database.OnConflictAction // contains filtered or unexported fields }
InsertStmt holds INSERT configuration.
func NewInsertStatement ¶ added in v0.14.0
func NewInsertStatement() *InsertStmt
func (*InsertStmt) IsReadOnly ¶ added in v0.14.0
func (stmt *InsertStmt) IsReadOnly() bool
type PreparedStreamStmt ¶ added in v0.14.0
PreparedStreamStmt is a PreparedStreamStmt using a Stream.
func (*PreparedStreamStmt) IsReadOnly ¶ added in v0.14.0
func (s *PreparedStreamStmt) IsReadOnly() bool
IsReadOnly reports whether the stream will modify the database or only read it.
func (*PreparedStreamStmt) Run ¶ added in v0.14.0
func (s *PreparedStreamStmt) Run(ctx *Context) (Result, error)
Run returns a result containing the stream. The stream will be executed by calling the Iterate method of the result.
func (*PreparedStreamStmt) String ¶ added in v0.14.0
func (s *PreparedStreamStmt) String() string
type ReIndexStmt ¶
type ReIndexStmt struct { TableOrIndexName string // contains filtered or unexported fields }
ReIndexStmt is a DSL that allows creating a full REINDEX statement.
func NewReIndexStatement ¶ added in v0.14.0
func NewReIndexStatement() *ReIndexStmt
func (*ReIndexStmt) IsReadOnly ¶
func (stmt *ReIndexStmt) IsReadOnly() bool
type Result ¶
type Result struct { Iterator document.Iterator Tx *database.Transaction // contains filtered or unexported fields }
Result of a query.
type SelectCoreStmt ¶ added in v0.14.0
type SelectCoreStmt struct { TableName string Distinct bool WhereExpr expr.Expr GroupByExpr expr.Expr ProjectionExprs []expr.Expr }
func (*SelectCoreStmt) Prepare ¶ added in v0.14.0
func (stmt *SelectCoreStmt) Prepare(*Context) (*StreamStmt, error)
type SelectStmt ¶
type SelectStmt struct { CompoundSelect []*SelectCoreStmt CompoundOperators []scanner.Token OrderBy expr.Path OrderByDirection scanner.Token OffsetExpr expr.Expr LimitExpr expr.Expr // contains filtered or unexported fields }
SelectStmt holds SELECT configuration.
func NewSelectStatement ¶ added in v0.14.0
func NewSelectStatement() *SelectStmt
func (*SelectStmt) IsReadOnly ¶ added in v0.14.0
func (stmt *SelectStmt) IsReadOnly() bool
type StreamStmt ¶
StreamStmt is a StreamStmt using a Stream.
type StreamStmtIterator ¶
StreamStmtIterator iterates over a stream.
type UpdateStmt ¶
type UpdateStmt struct { TableName string // SetPairs is used along with the Set clause. It holds // each path with its corresponding value that // should be set in the document. SetPairs []UpdateSetPair // UnsetFields is used along with the Unset clause. It holds // each path that should be unset from the document. UnsetFields []string WhereExpr expr.Expr // contains filtered or unexported fields }
UpdateConfig holds UPDATE configuration.
func NewUpdateStatement ¶ added in v0.14.0
func NewUpdateStatement() *UpdateStmt
func (*UpdateStmt) IsReadOnly ¶ added in v0.14.0
func (stmt *UpdateStmt) IsReadOnly() bool