Parser
A simple SQL parser based on Apache Calcite.
Install / Use
/learn @qed-solver/ParserREADME
Qed Parser
SQL parser for the Qed Solver based on that of Apache Calcite.
Requirements
Java version 19.
Install
With Nix
It is recommended to use the parser with Nix Shell:
nix shell github:qed-solver/parser
Usage
The parser accept list of paths to input files or folders containing input files:
qed-parser <path1> <path2> ...
Input format
The input files should have .sql extension, containing a list of allowed SQL statements:
CREATE TABLEstatements that declare the schema of available tables. The statements should be valid inMySQL. Foreign key is not yet supported. Example:
CREATE TABLE foo (
x INTEGER,
y VARCHAR NOT NULL,
PRIMARY KEY (x)
);
CREATE TABLE bar (
z FLOAT,
UNIQUE (z)
);
DECLARE (SCALAR|AGGREGATE) FUNCTIONstatements that declares the signature of custom functions. Example:
DECLARE SCALAR FUNCTION my_add(INTEGER, INTEGER) RETURNS INTEGER;
DECLARE AGGREGATE FUNCTION my_sum(INTEGER) RETURNS INTEGER;
SELECTstatements that represent the query. The statements should be valid SQLSELECTstatement.
The input file can interlace the declarations and queries, but tables and custom functions must be defined before use. Statements are not case-sensitive, but they must end with a semicolon.
The prover only accepts two queries in one single file for equivalence checking.
The example.sql and its correponding outputs may be helpful to understand how this works.
Output format
For each input file, the parser will dump a .json file as the input to qed-prover and a .rkt file as the input to qed-disprover.
License
Copyright 2021 The Qed Team
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an " AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Related Skills
oracle
344.1kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
prose
344.1kOpenProse VM skill pack. Activate on any `prose` command, .prose files, or OpenProse mentions; orchestrates multi-agent workflows.
Command Development
96.8kThis skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
Plugin Structure
96.8kThis skill should be used when the user asks to "create a plugin", "scaffold a plugin", "understand plugin structure", "organize plugin components", "set up plugin.json", "use ${CLAUDE_PLUGIN_ROOT}", "add commands/agents/skills/hooks", "configure auto-discovery", or needs guidance on plugin directory layout, manifest configuration, component organization, file naming conventions, or Claude Code plugin architecture best practices.
