1 unstable release
| 0.4.0 | Feb 18, 2020 |
|---|
#390 in #structures
115KB
2K
SLoC
MSDB - Mobile Secure DataBase
msdb is a user-friendly, intuitive and standalone database.
Getting started
Prerequisites
-
rustcinstalled(building). Nightly channel is recomended, while stable channel should also work. -
libsodiuminstalled. MSDB relies onsodiumoxide, which is a rust binding for libsodium.
Compiling
cargo build --release
Running
Command line interface
./msdb will initiate a command line interface
Execute script file
./msdb -i SCRIPTNAME will execute commands inside the script
Simple user guide
Structure in one graph

Commands reference
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.
Create database / Decrypt(Load) database / Exit / Logout
Only these commands can be executed without loading any database.
-
create DATABASENAMECreate a database by specifying its name.
-
decrypt DATABASENAMEDecrypt a database and load it into cache.
-
exitDrop everything inside cache and stop the database.
-
logoutSimilear to
exitbut the command line interface will not exit.
Create(Delete / Modify) Structure / Object / Cell
-
new struct STRUCTNAMECreate a new structure
-
new OBJECTNAMECreate a new object (Only work when you are inside a structure)
-
new CELLNAME CELLTYPE CELLCONTENTCreate 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 aslink
-
-
alter CELLNAME CELLTYPE CELLCONTENT[WIP]Change cell content / cell type (Only work when you are inside a object)
-
del CELLNAME CELLTYPE CELLCONTENTDelete cell (Only work when you are inside a object)
-
del OBJECTNAME / STRUCTNAMEDelete 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 OBJECTNAMEDelete object and every cell related
Select(deselect) Structure / Object / Cell
-
select STRUCTNAME/OBJECTNAME/CELLNAMEselect a structure/object/cell (It will select structure when you are inside database root, and select object if you are inside a structure, etc.)
-
leavedeselect a structure/object/cell (deselect structure when inside structure, etc.)
Listing / Querying cells
-
lslist cells inside object / objects inside structure / structures inside database
-
read CELLNAME[WIP]output cell content (Only work when you are inside a object)
-
pwdShow current location
Write to disk / Read from disk
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.
-
syncWrite database changes onto disk
-
load CELLNAMEExplicitly specify a cell to be loaded into cache. Normally, cells inside object will not automatically loaded due to slow performance.
Dangerous / Debugging
These commands should not be used unless you are absolutely sure what you are doing.
-
unload STRUCTURENAMEExplicitly remove structure from cache. May improve performance.
-
setprop NAME VALUECreate/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.
-
getpropView metadata properties
Commands for scripting
-
output OUTFILEwrite 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.
Support
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.
License
This project is licensed under the GNU General Public License v3.0 only.
Dependencies
~24MB
~185K SLoC