cviebig / bin-dump-sql-text

Interactive shell for parsing SQL statements and presenting their parse tree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SQL parser front end

This package provides a reduced shell for parsing SQL statements and serves as an interactive demonstration tool for SQL parsers generated by lib-sql-text [1] and it's dumper lib-dump-sql [2].

[1] https://github.com/cviebig/lib-sql-text

[2] https://github.com/cviebig/lib-dump-sql

Options

SQL parser:
  -h [ --help ]          produce help message
  -g [ --generator ] arg Output generator (console, plaintext, latex)
  -s [ --statement ] arg SQL statement(s) to parse
  -i [ --interactive ]   Interactive mode, prompting for inputs
  -o [ --stdout ]        Force use of stdout for all outputs

Invocations

--interactive:

res/interactive.png

Piping from stdin

Using the interactive switch it's also possible to run it in a batch mode by piping sql queries to standard input. In res/ you can find parse trees of Star Schema Benchmark queries (sql) produced by res/ssb.sh:

About

Interactive shell for parsing SQL statements and presenting their parse tree


Languages

Language:TeX 97.7%Language:PLpgSQL 1.2%Language:C++ 0.9%Language:CMake 0.2%Language:Shell 0.0%