Documentation ¶
Index ¶
- func ArrayValue(a types.Array) expr.LiteralValue
- func BlobValue(v []byte) expr.LiteralValue
- func BoolValue(v bool) expr.LiteralValue
- func CloneObject(t testing.TB, d types.Object) *object.FieldBuffer
- func DoubleValue(v float64) expr.LiteralValue
- func Dump(t testing.TB, v interface{})
- func DumpPebble(t testing.TB, pdb *pebble.DB)
- func Exec(db *database.Database, tx *database.Transaction, q string, ...) error
- func ExprList(t testing.TB, s string) expr.LiteralExprList
- func ExprRunner(t *testing.T, testfile string)
- func FunctionExpr(t testing.TB, name string, args ...expr.Expr) expr.Expr
- func Int64Ptr(n int64) *int64
- func IntegerValue(v int64) expr.LiteralValue
- func IteratorToJSONArray(w io.Writer, s database.RowIterator) error
- func MakeArray(t testing.TB, jsonArray string) types.Array
- func MakeArrayValue(t testing.TB, vs ...any) types.Value
- func MakeObject(t testing.TB, jsonDoc string) types.Object
- func MakeValue(t testing.TB, v any) types.Value
- func MakeValueBuffer(t testing.TB, jsonArray string) *object.ValueBuffer
- func MustExec(t *testing.T, db *database.Database, tx *database.Transaction, q string, ...)
- func MustQuery(t *testing.T, db *database.Database, tx *database.Transaction, q string, ...) *statement.Result
- func NewEngine(t testing.TB) *kv.Store
- func NewKey(t testing.TB, values ...types.Value) *tree.Key
- func NewTestDB(t testing.TB) *database.Database
- func NewTestTree(t testing.TB, namespace tree.Namespace) *tree.Tree
- func NewTestTx(t testing.TB) (*database.Database, *database.Transaction, func())
- func NullValue() expr.LiteralValue
- func ObjectValue(d types.Object) expr.LiteralValue
- func ParseExpr(t testing.TB, s string) expr.Expr
- func ParseExprs(t testing.TB, s ...string) []expr.Expr
- func ParseNamedExpr(t testing.TB, s string, name ...string) expr.Expr
- func ParseObjectPath(t testing.TB, p string) object.Path
- func ParseObjectPaths(t testing.TB, str ...string) []object.Path
- func ParsePath(t testing.TB, p string) expr.Path
- func Query(db *database.Database, tx *database.Transaction, q string, ...) (*statement.Result, error)
- func RequireArrayEqual(t testing.TB, want, got types.Array)
- func RequireJSONEq(t testing.TB, o any, expected string)
- func RequireObjEqual(t testing.TB, want, got types.Object)
- func RequireStreamEq(t *testing.T, raw string, res *chai.Result, sorted bool)
- func RequireStreamEqf(t *testing.T, raw string, res *chai.Result, sorted bool, msg string, ...)
- func RequireValueEqual(t testing.TB, want, got types.Value, msg string, args ...any)
- func TestExpr(t testing.TB, exprStr string, env *environment.Environment, want types.Value, ...)
- func TextValue(v string) expr.LiteralValue
- type Objs
- type ResultStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayValue ¶
func ArrayValue(a types.Array) expr.LiteralValue
ArrayValue creates a literal value of type Array.
func BlobValue ¶
func BlobValue(v []byte) expr.LiteralValue
BlobValue creates a literal value of type Blob.
func BoolValue ¶
func BoolValue(v bool) expr.LiteralValue
BoolValue creates a literal value of type Bool.
func CloneObject ¶
func DoubleValue ¶
func DoubleValue(v float64) expr.LiteralValue
DoubleValue creates a literal value of type Double.
func Exec ¶
func Exec(db *database.Database, tx *database.Transaction, q string, params ...environment.Param) error
func ExprRunner ¶
func IntegerValue ¶
func IntegerValue(v int64) expr.LiteralValue
IntegerValue creates a literal value of type Integer.
func IteratorToJSONArray ¶
func IteratorToJSONArray(w io.Writer, s database.RowIterator) error
IteratorToJSONArray encodes all the objects of an iterator to a JSON array.
func MakeObject ¶
MakeObject creates an object from a json string.
func MakeValueBuffer ¶
func MakeValueBuffer(t testing.TB, jsonArray string) *object.ValueBuffer
func MustExec ¶
func MustExec(t *testing.T, db *database.Database, tx *database.Transaction, q string, params ...environment.Param)
func ObjectValue ¶
func ObjectValue(d types.Object) expr.LiteralValue
ObjectValue creates a literal value of type Object.
func Query ¶
func Query(db *database.Database, tx *database.Transaction, q string, params ...environment.Param) (*statement.Result, error)
func RequireStreamEq ¶
func RequireStreamEqf ¶
func RequireValueEqual ¶
func TestExpr ¶
func TestExpr(t testing.TB, exprStr string, env *environment.Environment, want types.Value, fails bool)
func TextValue ¶
func TextValue(v string) expr.LiteralValue
TextValue creates a literal value of type Text.
Types ¶
type Objs ¶
func MakeObjects ¶
MakeObjects creates a slice of objects from json strings.
type ResultStream ¶
func ParseResultStream ¶
func ParseResultStream(stream string) *ResultStream
Click to show internal directories.
Click to hide internal directories.