kdrozd / dbtool

Command line tool to do some "ad-hoc" stuff with data in your database.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DBTool

Command line tool to do some "ad-hoc" stuff with data in your database.

Main goal of this tool is to simplify common operation on data in multidatabase work environment. This tool will never replace database native tooling or specialized applications targeting one database. It will work best in environment ask for simple commands from command line against different databases or you just have JRE. And it will not open interactive sessions. Think more of mysql -e "SELECT * from TABLE" that mysql>.

If you work with one database or need advance futures please consider using native tools or one of the tools below.

Some applications that I use:

  • usql - Universal database tool (Go)

  • pgcli - Tool for Postgresql (Python)

  • mycli - Tool for MySQL (Python)

  • litecli - Tool for SQLite (Python)

Requirements:

  • Java 11 (JRE)

  • Command line execution environment (Bash, Powershel,…​)

Functionalities

  • select Execute SQL SELECT command

  • insert Execute SQL INSERT command

  • update Execute SQL UPDATE command

  • delete Execute SQL DELETE command

How To?

How to disable colors in output?

You can set picocli.ansi system variable to false or environment variable NO_COLOR to any value. Please take a look at https://picocli.info/#_heuristics_for_enabling_ansi for more details.

How to display output as table?

Simple way involves setting output format to CSV and piping it to column command:

dbtool select "SELECT * from TABLE" | column -t -s, | less -S

Take a look at https://www.stefaanlippens.net/pretty-csv.html for more details.

About

Command line tool to do some "ad-hoc" stuff with data in your database.


Languages

Language:Java 100.0%