Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrResultClosed = errors.New("result already closed")
ErrResultClosed is returned when trying to close an already closed result.
Functions ¶
This section is empty.
Types ¶
type AlterStmt ¶ added in v0.7.0
AlterStmt is a DSL that allows creating a full ALTER TABLE query.
func (AlterStmt) IsReadOnly ¶ added in v0.7.0
IsReadOnly always returns false. It implements the Statement interface.
type AlterTableAddField ¶ added in v0.9.0
type AlterTableAddField struct { TableName string Constraint database.FieldConstraint }
func (AlterTableAddField) IsReadOnly ¶ added in v0.9.0
func (stmt AlterTableAddField) IsReadOnly() bool
IsReadOnly always returns false. It implements the Statement interface.
func (AlterTableAddField) Run ¶ added in v0.9.0
func (stmt AlterTableAddField) Run(tx *database.Transaction, _ []expr.Param) (Result, error)
Run runs the ALTER TABLE ADD FIELD statement in the given transaction. It implements the Statement interface.
type BeginStmt ¶ added in v0.8.0
type BeginStmt struct {
Writable bool
}
BeginStmt is a statement that creates a new transaction.
func (BeginStmt) IsReadOnly ¶ added in v0.8.0
type CommitStmt ¶ added in v0.8.0
type CommitStmt struct{}
CommitStmt is a statement that commits the current active transaction.
func (CommitStmt) IsReadOnly ¶ added in v0.8.0
func (stmt CommitStmt) IsReadOnly() bool
func (CommitStmt) Run ¶ added in v0.8.0
func (stmt CommitStmt) Run(tx *database.Transaction, args []expr.Param) (Result, error)
type CreateIndexStmt ¶
type CreateIndexStmt struct { IndexName string TableName string Path document.Path IfNotExists bool Unique bool }
CreateIndexStmt is a DSL that allows creating a full CREATE INDEX statement. It is typically created using the CreateIndex function.
func (CreateIndexStmt) IsReadOnly ¶
func (stmt CreateIndexStmt) IsReadOnly() bool
IsReadOnly always returns false. It implements the Statement interface.
func (CreateIndexStmt) Run ¶
func (stmt CreateIndexStmt) Run(tx *database.Transaction, args []expr.Param) (Result, error)
Run runs the Create index statement in the given transaction. It implements the Statement interface.
type CreateTableStmt ¶
CreateTableStmt is a DSL that allows creating a full CREATE TABLE statement.
func (CreateTableStmt) IsReadOnly ¶
func (stmt CreateTableStmt) IsReadOnly() bool
IsReadOnly always returns false. It implements the Statement interface.
func (CreateTableStmt) Run ¶
func (stmt CreateTableStmt) Run(tx *database.Transaction, args []expr.Param) (Result, error)
Run runs the Create table statement in the given transaction. It implements the Statement interface.
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.
func (DropIndexStmt) Run ¶
func (stmt DropIndexStmt) Run(tx *database.Transaction, args []expr.Param) (Result, error)
Run runs the DropIndex statement in the given transaction. 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.
func (DropTableStmt) Run ¶
func (stmt DropTableStmt) Run(tx *database.Transaction, args []expr.Param) (Result, error)
Run runs the DropTable statement in the given transaction. It implements the Statement interface.
type InsertStmt ¶
type InsertStmt struct { TableName string FieldNames []string Values expr.LiteralExprList }
InsertStmt is a DSL that allows creating a full Insert query.
func (InsertStmt) IsReadOnly ¶
func (stmt InsertStmt) IsReadOnly() bool
IsReadOnly always returns false. It implements the Statement interface.
func (InsertStmt) Run ¶
func (stmt InsertStmt) Run(tx *database.Transaction, args []expr.Param) (Result, error)
Run the Insert statement in the given transaction. It implements the Statement interface.
type Query ¶
type Query struct { Statements []Statement // contains filtered or unexported fields }
A Query can execute statements against the database. It can read or write data from any table, or even alter the structure of the database. Results are returned as streams.
type ReIndexStmt ¶ added in v0.7.0
type ReIndexStmt struct {
TableOrIndexName string
}
ReIndexStmt is a DSL that allows creating a full REINDEX statement.
func (ReIndexStmt) IsReadOnly ¶ added in v0.7.0
func (stmt ReIndexStmt) IsReadOnly() bool
IsReadOnly always returns false. It implements the Statement interface.
func (ReIndexStmt) Run ¶ added in v0.7.0
func (stmt ReIndexStmt) Run(tx *database.Transaction, args []expr.Param) (Result, error)
Run runs the Reindex statement in the given transaction. It implements the Statement interface.
type Result ¶
type Result struct { document.Stream RowsAffected int64 LastInsertKey []byte Tx *database.Transaction // contains filtered or unexported fields }
Result of a query.
type RollbackStmt ¶ added in v0.8.0
type RollbackStmt struct{}
RollbackStmt is a statement that rollbacks the current active transaction.
func (RollbackStmt) IsReadOnly ¶ added in v0.8.0
func (stmt RollbackStmt) IsReadOnly() bool
func (RollbackStmt) Run ¶ added in v0.8.0
func (stmt RollbackStmt) Run(tx *database.Transaction, args []expr.Param) (Result, error)