
Security News
Researcher Exposes Zero-Day Clickjacking Vulnerabilities in Major Password Managers
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
factorial-presto-parser
Advanced tools
This is a Ruby gem containing a parser for the Presto SQL dialect (now rebranded as Trino). It has been generated using the antlr4-native gem from the Presto grammar specification, found in the official Presto repository.
Note that this gem supports specifically the version 0.172 of Presto, since that's the one used by AWS Athena.
bundle install
rake build
gem install pkg/factorial-presto-parser-[version].gem
In irb
:
require 'presto_parser'
statement = PrestoParser::Parser.parse('SELECT 1')
puts statement.singleQuery
Note
We are using a manually modified version of the original grammar that excludes write operations and only allows database queries. This is accomplished by lowering the grammar's axiom down to the
query
rule, thus making anything else unrecognizable to the parser.Also, some constructs in the grammar prevented C++ compilation, so they have been removed or renamed. The changes made to the original grammar can be found in the
Presto.g4.patch
file.
To regenerate the parser code from the grammar file you can use
rake generate
Be aware that this will overwrite any changes in the C++ code of the parser, as well as the Makefile
found in the ext/presto_parser
directory.
To manually compile the C++ native extension you can do it like this:
rake compile
FAQs
Unknown package
We found that factorial-presto-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.