How to contribute¶
Error Reports¶
Please report any issue to the GitHub Issue Tracker:
Provide the Sample SQL (shortened and simplified, properly formatted)
State the exact Version of JSQLParser
State the RDBMS in use and point on the applicable Grammar specification
Please write in English and post Plain Text only (avoiding bitmap pictures).
Before reporting any issues, please verify your statement using JSQLFormatter Online.
Feature Requests¶
JSQLParser is a demand-driven software library, where many contributors have shared solutions for their own needs. Requests for new features have a good chance to get implemented when
the request is about a commonly used feature for one of the major RDBMS
or the request is backed by a sponsor or a bounty, which may attract developers to spend their time on it.
Implementing new Features¶
The team around JSQLParser warmly welcomes Code Contributions and Pull Requests. Please follow the guidance below and do not hesitate to ask us for assistance.
Create a new Git Branch¶
When starting afresh, clone JSQLParser from the GitHub repository:
git clone https://github.com/JSQLParser/JSqlParser.git
cd JSqlParser
git branch <new-branch>
When having a local repository already, then pull/merge from the GitHub repository:
cd JSqlParser
git pull origin master
git branch <new-branch>
Amend the Code¶
The JSQLParser is generated by JavaCC
based on the provided Grammar. The Grammar defines how a SQL Text is read and translated into Java Objects. Thus any contribution will depend on the following steps:
Edit the
JavaCC
Grammar atsrc/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
Add or edit the Java Classes at
src/main/java/net/sf/jsqlparser
to facilitate this Grammar.When have added new Java Classes, amend the Visitors, the Visitor Adaptors, the Deparsers and the Validators.
Provide Java Unit Tests at
src/test/java/net/sf/jsqlparser
to test the new feature
The test should call at least one time the method
assertSqlCanBeParsedAndDeparsed()
The test should ensure complete coverage of the new Java Classes.
The complete test suite must succeed.
Add the description of the new feature to the
README.md
file, section Extensions.Build the package with
Maven
and ensure, all checks do pass (PMD and CheckStyle and Code Formatting).
Commit a Pull Request¶
cd JSqlParser
git add -A
git commit -m <title> -m <description>
git push –set-upstream origin <new-branch>
Follow the advice on Meaningful Commit Messages and consider using Commitizen when describing your commits.