Command-line shell for issuing SQL to relational databases via JDBC.
A fork of the Marc Prud'hommeaux's sqlline project, also incorporating changes made by the LucidDB project, now modernized, mavenized and forkable in github.
sqlline is distributed under the 3-clause BSD License, meaning that you are free to redistribute, modify, or sell it with almost no restrictions.
It is distributed via the Maven Central Repository.
Copy the sqlline
script (or sqlline.bat
for Windows),
sqlline-VERSION-jar-with-dependencies.jar
and a JDBC driver jar into
the same directory. (Or just put sqlline
on your PATH
.)
$ sqlline -d com.mysql.jdbc.Driver
sqlline> !connect jdbc:mysql://localhost:3306/scott user password
sqlline> !tables
+------------+--------------+-------------+---------------+----------+
| TABLE_CAT | TABLE_SCHEM | TABLE_NAME | TABLE_TYPE | REMARKS |
+------------+--------------+-------------+---------------+----------+
| null | SCOTT | BONUS | TABLE | null |
| null | SCOTT | DEPT | TABLE | null |
| null | SCOTT | EMP | TABLE | null |
| null | SCOTT | SALGRADE | TABLE | null |
| null | metadata | COLUMNS | SYSTEM_TABLE | null |
| null | metadata | TABLES | SYSTEM_TABLE | null |
+------------+--------------+-------------+---------------+----------+
sqlline> SELECT 1 + 2 AS c;
+---+
| C |
+---+
| 3 |
+---+
sqlline> !quit
To get help:
sqlline --help
If you prefer, you can invoke Java directly, without using the
sqlline
script:
$ java -jar sqlline-VERSION-jar-with-dependencies.jar --help
Read the manual.
Use the following definition to use sqlline
in your maven project:
<dependency>
<groupId>sqlline</groupId>
<artifactId>sqlline</artifactId>
<version>1.1.9</version>
</dependency>
Prerequisites:
- Maven 3.2.1 or higher
- Java 1.5 or higher (1.8 preferred)
Check out and build:
git clone git://github.com/julianhyde/sqlline.git
cd sqlline
mvn package
- Marc Prud'hommeaux ([email protected])
- John V. Sichi ([email protected])
- Stephan Zuercher ([email protected])
- Sunny Choi
- John Pham
- Steve Herskovitz
- Jack Hahn
- Julian Hyde
- Joe Posner
- License: Modified BSD License
- Project site
- API
- Source code
- Developers list: sqlline-dev at googlegroups.com (archive, subscribe)
- Issues
- Release notes and history