DRILL-153 - fixed classpath computation
[incubator-drill.git] / sandbox / prototype / sqlline
1 #!/bin/bash
2 # sqlline - Script to launch SQL shell
3 #
4 # Example:
5 # $ ./sqlline
6 # sqlline> !connect jdbc:optiq:model=common/target/test-classes/donuts-model.json admin admin
7
8 # Build classpath on first call. (To force rebuild, remove .classpath.)
9 if [ ! -f .classpath ]; then
10     (cd sqlparser; mvn dependency:build-classpath -Dmdep.outputFile=../.classpath)
11     echo -n :sqlparser/target/classes/ >> .classpath
12 fi
13
14 exec java -cp "$(cat .classpath)" sqlline.SqlLine "$@"
15
16 # End sqlline