Skip to content

sk77github/python_parse_sql.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

python_parse_sql.py

for parse sql statement with Python,like lex/yacc

output example:

select b,z,a from cuishou where b = 'k' and z > 6 and y = 5 order by b,z

['SELECT', ['b', 'z', 'a'], 'FROM', 'cuishou', 'WHERE', ['b', '=', 'k'], 'AND', ['z', '>', '6'], 'AND', ['y', '=', '5'], 'ORDER', 'BY', ['b', 'z']]

  • and1_expr: ['z', '>', '6']
  • and2_expr: ['y', '=', '5']
  • columns: ['b', 'z', 'a']
  • order_by_terms: ['b', 'z']
  • table: ['cuishou']
  • where_expr: ['b', '=', 'k']

Expected "SELECT"

About

for parse sql statement with Python,like lex/yacc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages