Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Drill, mail # dev - [2/4] git commit: Add sqlline launcher script.


Copy link to this message
-
[2/4] git commit: Add sqlline launcher script.
jacques@... 2013-06-19, 23:30
Add sqlline launcher script.

Signed-off-by: Jacques Nadeau <[EMAIL PROTECTED]>
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/65ffe9bd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/65ffe9bd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/65ffe9bd

Branch: refs/heads/execwork
Commit: 65ffe9bd020cddb29b3aefe398928c4e36c76565
Parents: 11a1fce
Author: Julian Hyde <[EMAIL PROTECTED]>
Authored: Tue Jun 18 10:27:40 2013 -0700
Committer: Jacques Nadeau <[EMAIL PROTECTED]>
Committed: Wed Jun 19 08:49:04 2013 -0700

----------------------------------------------------------------------
 sandbox/prototype/sqlline | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/65ffe9bd/sandbox/prototype/sqlline
----------------------------------------------------------------------
diff --git a/sandbox/prototype/sqlline b/sandbox/prototype/sqlline
new file mode 100755
index 0000000..9baab78
--- /dev/null
+++ b/sandbox/prototype/sqlline
@@ -0,0 +1,16 @@
+#!/bin/bash
+# sqlline - Script to launch SQL shell
+#
+# Example:
+# $ ./sqlline
+# sqlline> !connect jdbc:optiq:model=common/target/test-classes/donuts-model.json admin admin
+
+# Build classpath on first call. (To force rebuild, remove .classpath.)
+if [ ! -f .classpath ]; then
+    (cd sqlparser; mvn dependency:build-classpath -Dmdep.outputFile=../.classpath)
+    find . -type d -name classes |awk 'BEGIN {ORS=":"} {print}' >> .classpath
+fi
+
+exec java -cp "$(cat .classpath)" sqlline.SqlLine "$@"
+
+# End sqlline