NarDB Shell
Menus, shortcuts and >> commands — all running on the same command layer.
NarDB Shell is a keyboard-driven UI. The menu bar is at the top, the query editor and result table are in the middle, and the messages and the >> command line are at the bottom.
Menus, shortcuts and the command line run the same commands. For example, File → New ▸ Database and create_local_database use the same code.
Keyboard#
| Key | What it does |
|---|---|
| Esc | Opens the menu. ← → move between menus, ↑ ↓ between items, Enter selects. |
| Ctrl+M | Opens the menu, in terminals that can tell Ctrl+M from Enter. |
| F10 | Opens the menu. |
| Ctrl+L | Moves to the >> command line. |
| F6 / Shift+F6 | Moves between editor, results and command line. |
| F5 / Ctrl+R | Runs the script in the editor. |
| Ctrl+S | Saves the script as .nqf. |
| Ctrl+N / Ctrl+O | Creates a new database / opens an existing one. |
| Ctrl+Q | Quits; asks first if there are unsaved changes. |
In dialogs, Tab moves to the next control, Space selects, Enter runs and Esc closes.
The left end of the status bar shows the menu key. "Ctrl+M Menu" means your terminal can tell Ctrl+M apart from Enter; "Esc Menu" means it cannot. On macOS the Option and Cmd keys do not reach programs in most terminals, so the main keys are Esc and Ctrl.
Commands#
create_local_database -f <path.ndbc> [-e keychain|passphrase|none]
open_database_container -f <path.ndbc>
show_recent_files
create_schema -n <name> # puts a schema template in the editor
describe_schema -n <name>
show_schemas
create_user -n <name> [-p <password>] # without -p a password dialog opens
show_users
grant -u <user> -s <schema|*> -p read|write|admin
revoke -u <user> -s <schema|*>
set_pool [-c <connections>] [-q <queries>] [-t <seconds>]
show_pool
encrypt_database [-e keychain|passphrase] # encrypts, or changes where the key lives
rotate_key # renews the data key
backup_database -f <path.ndbz> # encrypted backup
restore_database -f <backup.ndbz> -t <new.ndbc>
run_query # F5
open_query -f <path.nqf>
save_current -f <path.nqf>
database_info
close_database_container
help
exitQuote paths that contain spaces: save_current -f "~/Queries/member list.nqf".
A password given with -p is written to the command history as ••••••.
Several databases#
More than one .ndbc can be open at the same time. Queries run on the active one. The active database is shown in the status bar and is changed from the Windows menu.