Skip to content

shakeelansari63/sqlyser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQLYSER

An SQL analyser program to analyse SQL queries using simple Regular expressions.

Requirement

Python3

Features

  • Get Source tables list from SQL
  • Get Target table name from SQL
  • Convert subqueries to temp tables and generate SQL

Installation

  • Clone this repo and run following from terminal
python setup.py install

Example and How to use

from sqlyser import SQL
sqlStr = '''
insert into a_target /* target Table */
(c1, c2, c3) 
select b.c1, b.c2, b.c3 
from ( select c1, c2 from b ) b /* Source Table b */
inner join c /* Source Table c */
on b.c4 = c.c4;
;'''
sql = SQL(sqlStr)
print(sql.getSourceTables())
{'B','C'}

About

Analyse your SQL Queries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages