Skip to content

seraphain/dbcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Database Command Line Tool

Command

Usage

Usage: dbcli [-hV] -j=<jdbcUrl> [-u=<username>] [-p=<password>] [-f]
             [-t=<time>] [-i=<interval>] [-c] [-r] inputs...
database command line tool
*     inputs...          SQL(s) or File(s) to execute.
  -h, --help             Show this help message and exit.
  -V, --version          Print version information and exit.
* -j, --jdbc=<jdbcUrl>   Database JDBC url to connect.
  -u, --username=<username>
                         Database username to connect.
  -p, --password=<password>
                         Database password to connect.
  -f, --file             Execute SQL statements in files.
                           Default: false
  -t, --times=<time>     Execute times.
                           Default: 1
  -i, --interval=<interval>
                         Interval time between SQL executions in milliseconds.
                           Default: 0
  -c, --connection       Create new JDBC connections for every request.
                           Default: false
  -r, --results          Show execution results.
                           Default: true

Execute SQL

./dbcli -j [JDBC_URL] -u [USER] -p [PASSWORD] SQL_1 SQL_2

Execute SQL File

./dbcli -j [JDBC_URL] -u [USER] -p [PASSWORD] -f SQL_FILE_1 SQL_FILE_2

Execute multiple times

./dbcli -j [JDBC_URL] -u [USER] -p [PASSWORD] -t [TIMES] SQL_1

help

./dbcli -h
./dbcli --help

version

./dbcli -V
./dbcli --version

JDBC URL:

  • MySQL: jdbc:mysql://[IP]:[PORT]/[SCHEMA]?autoReconnect=true&characterEncoding=utf8&useSSL=false

  • Oracle SID: jdbc:oracle:thin:@[IP]:[PORT]:[SID]

  • Oracle Service Name: jdbc:oracle:thin:@//[IP]:[PORT]:[SID]/[SERVICENAME]

  • PostgreSQL: jdbc:postgresql://[IP]:[PORT]/[DATABASE]

About

database command line tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published