Batch File Execution
NanoVaultDB allows you to execute multiple queries and commands in sequence by reading them directly from a script file.
1. Create a Script File
Example & Syntax
USE exchange_db;
CREATE HFT TABLE my_trades (price DOUBLE PRECISION 8, quantity DOUBLE PRECISION 8) SYMBOL 1;
ADD INDICATOR "sma" ("10") ON SYMBOL 1 COLUMN_NO 0 TICKS 1;Write your database queries and statements sequentially inside a file with a '.nanodb' extension. Each command should end with a semicolon. The file can contain any standard NanoVaultDB statements, such as USE, CREATE HFT TABLE, or ADD INDICATOR.
2. Execute the Script File
Example & Syntax
EXECUTE DB FILE '/absolute/path/to/commands.nanodb';
Use the EXECUTE DB FILE statement inside the NanoVaultDB CLI or query engine to run all commands in the file. The statement requires an absolute or relative string path pointing to the script file. Note: The engine will raise an error if the file does not end with a '.nanodb' extension.