Documentation ¶
Overview ¶
Package unqlitego provides a Golang binding for UnQLite.
Index ¶
- type Cursor
- func (cr *Cursor) Close() error
- func (cr *Cursor) Delete() error
- func (cr *Cursor) First() error
- func (cr *Cursor) IsValid() bool
- func (cr *Cursor) Key() (key []byte, err error)
- func (cr *Cursor) Last() error
- func (cr *Cursor) Next() error
- func (cr *Cursor) Prev() error
- func (cr *Cursor) Reset() error
- func (cr *Cursor) Seek(key []byte) error
- func (cr *Cursor) SeekGE(key []byte) error
- func (cr *Cursor) SeekLE(key []byte) error
- func (cr *Cursor) Value() (value []byte, err error)
- type Database
- func (db *Database) Append(key, value []byte) (err error)
- func (db *Database) Begin() (err error)
- func (db *Database) Close() (err error)
- func (db *Database) Commit() (err error)
- func (db *Database) Compile(jx9 string, vm *VM) (string, error)
- func (db *Database) Cursor() (*Cursor, error)
- func (db *Database) Delete(key []byte) (err error)
- func (db *Database) Fetch(key []byte) (value []byte, err error)
- func (db *Database) Rollback() (err error)
- func (db *Database) Store(key, value []byte) (err error)
- type Library
- type UnQLiteError
- type VM
- func (vm *VM) Execute() int
- func (vm *VM) ExtractBool(v string) (bool, error)
- func (vm *VM) ExtractFloat64(v string) (float64, error)
- func (vm *VM) ExtractInt(v string) (int, error)
- func (vm *VM) ExtractInt64(v string) (int64, error)
- func (vm *VM) ExtractString(v string) (string, error)
- func (vm VM) Free()
- func (vm *VM) Result() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor represents an UnQLite database cursor.
func (*Cursor) Seek ¶
Seek will search the cursor for an exact match. If the record exists the cursor is left pointing to it. Otherwise it is left pointing to EOF and UNQLITE_NOTFOUND is returned.
func (*Cursor) SeekGE ¶
SeekGE will search the cursor and left pointing to the smallest key in the database that is larger than (pKey/nKey). If the database contains no keys larger than (pKey/nKey), the cursor is left at EOF. This option have sense only if the underlying key/value storage subsystem support range search (i.e: B+Tree, R+Tree, etc.). Otherwise this option is ignored and an exact match is performed.
func (*Cursor) SeekLE ¶
SeekLE will search the cursor and left pointing to the largest key in the database that is smaller than (pKey/nKey). If the database contains no keys smaller than (pKey/nKey), the cursor is left at EOF. This option have sense only if the underlying key/value storage subsystem support range search (i.e: B+Tree, R+Tree, etc.). Otherwise this option is ignored and an exact match is performed.
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database represents a UnQLite Database.
func NewDatabase ¶
NewDatabase creates and initalizes a new UnQLite database connection.
func (*Database) Append ¶
Append will write a new record into the database. If the record does not exists it will be created, else the new data is appended to the end of the old data.
type Library ¶
type Library struct {
// contains filtered or unexported fields
}
Library represents the UnQLite Library Control.
func (*Library) Init ¶
func (l *Library) Init()
Init will initialize the library. After call init, the library must be shutdown first before any re-configuration can be done. Subsequent calls result in NOOP. This is autocalled when a database is opened.
func (*Library) IsInitialized ¶
IsInitialized will return boolean indicating if the library is initialized.
func (*Library) IsThreadSafe ¶
IsThreadSafe returns a boolean identifiying if the UnQLite library is compiled Thread Safe.
type UnQLiteError ¶
type UnQLiteError int
UnQLiteError is returned on both UnQLite native errors as well as UnQLite Go errors. Native errors are within the range of '<= 0' (Equal and lesser then Zero) while the errors from UnQLite Go are > 0 (Greater then Zero).
( UnQLiteError <= 0 ) Native Errors ( UnQLiteError > 0 ) UnQLite Go Errors.
func (UnQLiteError) Error ¶
func (e UnQLiteError) Error() string
Error returns the string representation of the UnQLiteError.
func (UnQLiteError) String ¶
func (e UnQLiteError) String() string
type VM ¶
type VM struct {
// contains filtered or unexported fields
}
VM Represents an UnQLite/Jx9 Virtual Machine.
func (*VM) ExtractBool ¶
ExtractBool will extract the result from the Virtual Machine as bool.
func (*VM) ExtractFloat64 ¶
ExtractFloat64 will extract the result from the Virtual Machine as float64.
func (*VM) ExtractInt ¶
ExtractInt will extract the result from the Virtual Machine as int.
func (*VM) ExtractInt64 ¶
ExtractInt64 will extract the result from the Virtual Machine as int64.
func (*VM) ExtractString ¶
ExtractString will extract the result from the Virtual Machine as string.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
The JX9 Package represents a JX9 script code with the ability to compile and execute the code.
|
The JX9 Package represents a JX9 script code with the ability to compile and execute the code. |
The collections package represents a high level approach to use unqlite trough collections which allow reading/writing/deleting/updating documents (JSONs) to and from the unqlite database.
|
The collections package represents a high level approach to use unqlite trough collections which allow reading/writing/deleting/updating documents (JSONs) to and from the unqlite database. |