#table #database-table #redb #command-line #delete #command-line-tool #edit

bin+lib redbcli

RedbCLI is a command-line tool for managing and operating Redb databases. It provides various commands to create, delete, query, and edit database tables.

7 releases

0.1.6 Dec 9, 2024
0.1.5 Dec 7, 2024
0.1.0 Mar 11, 2024

#935 in Command line utilities

Download history 7/week @ 2024-09-23 4/week @ 2024-09-30 340/week @ 2024-12-02 288/week @ 2024-12-09

628 downloads per month

MIT/Apache

22KB
466 lines

Rust - redb cli

RedbCLI is a command-line tool for managing and operating Redb databases. It provides various commands to create, delete, query, and edit database tables.

Requires

Need vim

Features

  • Set database path
  • Use specific tables
  • Edit table data
  • Query table information
  • Create and delete tables

Installation

  1. Ensure you have Rust and Cargo installed.
  2. Clone the project repository:
git clone https://github.com/jokemanfire/redbcli
cd redbcli
  1. Build the project:
cargo build --release
  1. Add the generated executable to your PATH:
cp target/release/redbcli /usr/local/bin/

Usage

  1. Start RedbCLI:
redbcli
  1. Set the database path:
set /path/to/your/database
  1. Use a specific table:
use your_table_name
  1. Query table information:
info tables
info key your_key
info table your_table_name
  1. Edit table data:
edit
  1. Create a new table:
create your_table_name
  1. Delete a table:
delete your_table_name
  1. Exit the program:
exit

Command List

  • set : Set the database path.
  • use : Use a specific table.
  • edit: Edit the data of the current table.
  • info [tables | key | table ]: Query table information.
  • create : Create a new table.
  • delete : Delete a table.
  • exit: Exit the program.

Example

$ redbcli
DB:[/path/to/your/database] TAB:[] 
>> set /path/to/your/database
-> set database success! 

DB:[/path/to/your/database] TAB:[] 
>> use my_table
-> Use table my_table

DB:[/path/to/your/database] TAB:[my_table] 
>> info tables
+------------------+
|      Tables      |
+------------------+
|     my_table     |
+------------------+

DB:[/path/to/your/database] TAB:[my_table] 
>> info key my_key
-> data 
{
  "my_key": "my_value"
}

DB:[/path/to/your/database] TAB:[my_table] 
>> edit
-> Save data to update the database

DB:[/path/to/your/database] TAB:[my_table] 
>> create new_table
-> Table created successfully

DB:[/path/to/your/database] TAB:[my_table] 
>> delete new_table
-> Table deleted successfully

DB:[/path/to/your/database] TAB:[my_table] 
>> exit
-> Exiting ... 

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request if you have any improvements or bug fixes.

For more detailed information, please refer to the source code and documentation.

Dependencies

~9–18MB
~265K SLoC