[SQL Definition Collation][SQLServer]Collate the g4 files of SQL definitions
See original GitHub issueHi community,
This issue is to collate the SQL definitions of SQLServer. Therefore, we can support parsing more SQLs. We need your interaction! If you
- Be familiar with
g4 file
of Antlr (The grammars are RegularExpression-like)- Understand the
SQLServer grammars
then welcome!
Background
How is a SQL parsed?
SQL definition file
->(Parse to)
AST
->(Visit it)
SQLStatment
Process
- Compare
SQL definitions
in Oficial SQL Doc and ShardingSphere SQL Doc - If there is any difference in ShardingSphere SQL Doc, please correct them referring to Official SQL Doc
- Run
mvn install the current_file_module
- Check whether there are any exceptions. If indeed, please fix them. (Especially
xxxVisitor.class
) - Add new corresponding SQL case in SQL Cases and expected parsed result in Expected Statment XML
- 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
: ...
;
- Here is a Chinese version for reference.
subtask
1、DML
- select offical doc
- insert offical doc
- update offical doc
- delete offical doc
- merge offical doc
2、DDL-ALTER
- alter table offical doc
- alter database offical doc
- alter procedure offical doc
- alter function offical doc
- alter view offical doc
- alter index offical doc
- alter schema offical doc
- alter trigger offical doc
- alter sequence offical doc
- alter service offical doc
3、DDL-CREATE
- create table offical doc
- create index offical doc
- create database offical doc
- create function offical doc
- create procedure offical doc
- create service offical doc
- create view offical doc
- create trigger offical doc
- create schema offical doc
- create sequence offical doc
4、DDL-DROP
- drop table offical doc
- drop index offical doc
- drop database offical doc
- drop function offical doc
- drop procedure offical doc
- drop service offical doc
- drop view offical doc
- drop trigger offical doc
- drop schema offical doc
- drop sequence offical doc
5、DCL
- grant offical doc
- revoke offical doc
- deny offical doc
- revert offical doc
- setuser offical doc
- alter user offical doc
- alter role offical doc
- alter login offical doc
- create user offical doc
- create role offical doc
- create login offical doc
- drop user offical doc
- drop role offical doc
- drop login offical doc
6、TCL
- tranction offical doc
- rollback tranction offical doc
- commit tranction offical doc
- save tranction offical doc
- commit work offical doc
- rollback work offical doc
7、DAL
- explain offical doc
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (16 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
Next, I’ll try to work on DCL statements.
Hello , this issue has not received a reply for several days. This issue is supposed to be closed.