Crates.io | msdb |
lib.rs | msdb |
version | 0.4.0 |
source | src |
created_at | 2020-02-18 06:18:47.480023 |
updated_at | 2020-02-18 06:18:47.480023 |
description | Mobile Secure DataBase |
homepage | |
repository | https://github.com/moelife-coder/msdb |
max_upload_size | |
id | 210234 |
size | 231,440 |
msdb is a user-friendly, intuitive and standalone database.
rustc
installed(building). Nightly channel is recomended, while stable channel should also work.
libsodium
installed. MSDB relies on sodiumoxide
, which is a rust binding for libsodium.
cargo build --release
./msdb
will initiate a command line interface
./msdb -i SCRIPTNAME
will execute commands inside the script
Both commands in the command script and commands in the cli follows the same structure:
COMMAND [COMMAND ARGUMENTS]
Each line in command script will be treated as a command.
Only these commands can be executed without loading any database.
create DATABASENAME
Create a database by specifying its name.
decrypt DATABASENAME
Decrypt a database and load it into cache.
exit
Drop everything inside cache and stop the database.
logout
Similear to exit
but the command line interface will not exit.
new struct STRUCTNAME
Create a new structure
new OBJECTNAME
Create a new object (Only work when you are inside a structure)
new CELLNAME CELLTYPE CELLCONTENT
Create a new cell (Only work when you are inside a object)
Available cell type & cell content:
TYPE = literal
; CONTENT = anything in utf-8
TYPE = blob
; CONTENT = any filename
(file content will be written into database)
TYPE = link
; CONTENT = another cell's identifier
/ another field identifier/another cell's identifier
/ another structure identifier/another field identifier/another cell's identifier
TYPE = revlink
; CONTENT = same as link
alter CELLNAME CELLTYPE CELLCONTENT
[WIP]
Change cell content / cell type (Only work when you are inside a object)
del CELLNAME CELLTYPE CELLCONTENT
Delete cell (Only work when you are inside a object)
del OBJECTNAME / STRUCTNAME
Delete object / structure. Note that due to preformance issue, cells in object may not be deleted. If you are willing to sacrifice preformance to minify database storage, please use wipe
.
wipe OBJECTNAME
Delete object and every cell related
select STRUCTNAME/OBJECTNAME/CELLNAME
select a structure/object/cell (It will select structure when you are inside database root, and select object if you are inside a structure, etc.)
leave
deselect a structure/object/cell (deselect structure when inside structure, etc.)
ls
list cells inside object / objects inside structure / structures inside database
read CELLNAME
[WIP]
output cell content (Only work when you are inside a object)
pwd
Show current location
Note that due to preformance issue, msdb will not automatically write and/or sync with disk, meaning that everyting you done in database is temporary. You will need following commands to manually do that.
sync
Write database changes onto disk
load CELLNAME
Explicitly specify a cell to be loaded into cache. Normally, cells inside object will not automatically loaded due to slow performance.
These commands should not be used unless you are absolutely sure what you are doing.
unload STRUCTURENAME
Explicitly remove structure from cache. May improve performance.
setprop NAME VALUE
Create/alter a metadata propertie. If current location is in database root, it will write to main metadata; if in a structure, it will write to structure metadata; if in a object, it will write to cell-list metadata; if in a cell, it will write to field metadata.
getprop
View metadata properties
output OUTFILE
write command result output uinto OUTFILE.
Special note: if you are using a command script, note that if you leave a optional parameter blank (for example, database password when decrypting), msdb will prompt for the parameter.
You may use Github Issues to report bugs. Please note that currently the application is still in early-stage, and there might be many bugs.
sync
This project is licensed under the GNU General Public License v3.0 only.