question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[SQL Definition Collation][SQLServer]Collate the g4 files of SQL definitions

See original GitHub issue

Hi community,

This issue is to collate the SQL definitions of SQLServer. Therefore, we can support parsing more SQLs. We need your interaction! If you

  1. Be familiar with g4 file of Antlr (The grammars are RegularExpression-like)
  2. Understand the SQLServer grammars

then welcome!

Background

How is a SQL parsed? SQL definition file ->(Parse to) AST ->(Visit it)
SQLStatment

Process

  1. Compare SQL definitions in Oficial SQL Doc and ShardingSphere SQL Doc
  2. If there is any difference in ShardingSphere SQL Doc, please correct them referring to Official SQL Doc
  3. Run mvn install the current_file_module
  4. Check whether there are any exceptions. If indeed, please fix them. (Especially xxxVisitor.class)
  5. Add new corresponding SQL case in SQL Cases and expected parsed result in Expected Statment XML
  6. Run SQLParserParameterizedTest to make sure no exceptions.

Notice

1.Left recursion can not work well in Antlr4,

a
  : b
  | a b
  ;
b
  : a c
  ;
c
  : ...
  ;

you can consider the following one,

a
  : b*
  ;
b
  : a c
  ;
c
  : ...
  ;
  1. Here is a Chinese version for reference.

subtask

1、DML

2、DDL-ALTER

3、DDL-CREATE

4、DDL-DROP

5、DCL

6、TCL

7、DAL

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:17 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
ThanoshanMVcommented, Nov 27, 2021

Hi @jingshanglu, @tristaZero, @Icesource

I completed TCL and DAL statements. Please refer to the submitted PRs. If there is anything to be changed, please let me know.

  1. For TCL statements:
  1. For DAL statements:

Next, I’ll try to work on DCL statements.

1reaction
github-actions[bot]commented, Oct 8, 2022

Hello , this issue has not received a reply for several days. This issue is supposed to be closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SQL Definition - SQLShack
The SQL definition is a language to define database objects and manipulate the data. There were several revisions to define how will be...
Read more >
What is Structured Query Language (SQL)? - TechTarget
SQL commands are divided into several different types, including the following: Data Definition Language (DDL) commands are also called data definition commands ...
Read more >
SQL File Format - A Structured Query Language Data File
It is used to write SQL statements for CRUD (Create, Read, Update, and Delete) operations on databases. SQL files are common while working...
Read more >
Client-Side SQL Query Parsing with ANTLR - Rockset
The power of ANTLR is to generate files from this grammar with which we can do our logic. antlr4 -Dlanguage=JavaScript <GrammarFileName>.g4. is ...
Read more >
SQL Syntax - W3Schools
Tables contain records (rows) with data. In this tutorial we will use the well-known Northwind sample database (included in MS Access and MS...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found