Limedb is a local wrapper for a sqlite database. It is designed to make interacting with the database easier, to eventually provide similar functionality to Notion or Obsidian, but with more flexibility.
limedb db new [DB-name] [Key flags][Not null]:[Column type]:[Column name]{[Default value]}
# Eg:
limedb db new pets P:TEXT:name{default} N:TEXT:gender{F} N::breed{Dog}
limedb db new pets P:TEXT:name{default} N:TEXT:gender{F} N:INT:age :REAL:height_cmBy default, this will soft delete a database.
limedb db rm [DB-NAME]
# Eg:
limedb db rm petslimedb db lslimedb add-entry [column names and values]...
# Eg:
limedb --db pets add-entry name{Woofy} age{5} gender{M} breed{Beagle}limedb rm-entries-all
limedb rm-entries-where [Column name]:[Operation]{[Value]}
# Remove all database entries
limedb --db pets rm-entries-all
# Remove database entries conditionally
limedb --db pets rm-entries-where name:like{W%}
# Adding multiple conditions will logically AND them together
limedb --db pets rm-entries-where "age:>{5}" gender:!={F} height_cm:between{10:30} name:nullThis will create a backup of the database in its current state.
limedb backup new
# Eg:
limedb --db pets backup new
limedb --db pets backup new -m "Backup before risky operation"limedb backup ls
# Eg:
limedb --db pets backup lslimedb backup rm [Backup id]
# A backup id can be obtained through the `limedb backup ls` command. Eg:
limedb --db pets backup ls
limedb --db pets backup rm 1This will restore the selected database to its state at the time of the backup.
limedb backup restore [Backup id]
# A backup id can be obtained through the `limedb backup ls` command. Eg:
limedb --db pets backup ls
limedb --db pets backup restore 1| Flag | Action |
|---|---|
--db |
Provide the database that operations will operate on. |
--with-config |
Provide comma separated list of configuration options. |
# Use --db to select the `pets` database.
limedb --db pets add-entry name{Woofy} age{5} gender{M}
# --with-config to set the `soft_deletion` and `limedb_home` options in the current run of limedb.
limedb db rm pets --confirm --with-config soft_deletion:false,limedb_home:/etc/limedb/| Config option | Action | Valid args |
|---|---|---|
limedb_home |
Set the home directory limedb. (Default $HOME/.limedb/). |
|
log_mode |
Set how logs should be reported. (Default file). |
file, stdout, stderr |
log_level |
The level of logging. (Default info). |
info, warn, debug, error |
soft_deletion |
Soft delete databases. (Default true). |
true, false |
default_db |
Default db used for operations, (Default None). |
- Proper support for foreign keys (Partially done)
- Add syntax for adding foreign keys
- Add option in where clauses to input raw sqlite
- Operations
- alter
- restore soft deleted db and update master db
- List databases and properties
- Command templates
- Sub document creation (eg. Adding a html file to a row)
- (Maybe) Dynamic Cobra subcommands
- More complex deletions, eg extracting a subset of data into a new table
- Add soft deletion for rows
- Command templates/aliases
- Password authentication for sqlite db
- HTMX front end interface
- lua scripts to execute on db hooks