|Purpose:||Create / Read / Write a NoSQL database|
|Format:||UNQLITE [/RWC [/RO [/MM] /RW /TEMP /MM] [/DB:"name"] [/C] [/D key] [/R key] [/KVBA "key" handle length] [/KVF "key" filename length] [/KVFA "key" filename length] [/KVS "key" "value"] [/KVSA "key" "string"]|
UnQLite is an embedded NoSQL (Key/Value store and Document-store) database engine. UnQLite reads and writes directly to ordinary disk files. The complete database with multiple collections is contained in a single disk file. The database file format is cross-platform, you can copy a database between 32-bit and 64-bit systems or between big-endian and little-endian architectures.
You can only perform one operation (open, close, write, read, etc.) each time you call UNQLITE. For example:
unqlite /db:"test.db" /kvs "keyone" "This is a string value assigned to keyone"
unqlite /db:"test.db" /c
If filename is ":mem:", then a private in-memory database is created. The in-memory database will be discarded when the database is closed.
UNQLITE does not support extended Unicode characters for the database name.
Both keys and values are treated as arrays of bytes, so the content can be ASCII strings, Unicode strings, binary blogs, or disk files.
The maximum size of a file for /KVF or /KVFA is dependent on the RAM and disk space available.
UNQLITE has an internal command variable:
|%_unq_db||The name of the current database|
|/DB:name||Open an existing database for a read / write / delete operation. The database name should be quoted. You need to use the same name when calling any of the read / write options. If this option is omitted, UNQLITE will use the last database name (if any).|
|/KVB||Create a key / binary blob value. If the key exists, it will be overwritten with the new value. handle is a handle returned by @BALLOC; length is the length to write (or -1 for the entire buffer).|
|/KVBA||Append a binary blob to the value of an existing key. handle is a handle returned by @BALLOC; length is the length to write (or -1 for the entire buffer).|
|/KVF||Create a key / file value pair. If the key exists, it will be overwritten with the new value. length is the length of the file to write (or -1 for the entire file).|
|/KVFA||Append a file to the value of an existing key. length is the length of the file to write (or -1 for the entire file).|
|/R||Read the specified key and display the value. If the key doesn't exist (or doesn't have a value) UNQLITE will not display anything.|
|/RW||Open the database with read+write privileges. If the database does not exist, an error is returned.|
|/TEMP||A private, temporary on-disk database will be created. The database will be deleted when the database is closed.|