Skip to content

Instantly share code, notes, and snippets.

@tori3852
Created February 9, 2018 09:24
Show Gist options
  • Save tori3852/22098f70f5e67b0c2f21e14d3801f1d4 to your computer and use it in GitHub Desktop.
Save tori3852/22098f70f5e67b0c2f21e14d3801f1d4 to your computer and use it in GitHub Desktop.
Run h2 locally
mvn dependency:get -Dartifact='com.h2database:h2:1.4.196'
java -jar ~/.m2/repository/com/h2database/h2/1.4.196/h2-1.4.196.jar &
java -cp ~/.m2/repository/com/h2database/h2/1.4.196/h2-1.4.196.jar org.h2.tools.RunScript -url jdbc:h2:~/test -user sa -showResults -script <(cat <<EOF
WITH RECURSIVE fibonacci (n, fib_n, next_fib_n) AS
(
SELECT 1, 0, 1
UNION ALL
SELECT n + 1, next_fib_n, fib_n + next_fib_n
FROM fibonacci WHERE n < 10
)
SELECT * FROM fibonacci;
EOF
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment