Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A python module that gives access to PostgreSQL's query parser, for turning SQL into a parse tree.

License

Notifications You must be signed in to change notification settings

srikiraju/psqlparse

 
 

Repository files navigation

psqlparse

Build Status

This Python module uses the libpg_query to parse SQL queries and return the internal PostgreSQL parsetree.

Installation

pip install psqlparse

Usage

import psqlparse
statements = psqlparse.parse('SELECT * from mytable')
used_tables = statements[0].tables()  # ['my_table']

Development

  1. Install requirements:
pip install -r requirements.txt
  1. Build Cython extension
USE_CYTHON=1 python setup.py build_ext --inplace
  1. Perform changes

  2. Run tests

pytest

Contributors

About

A python module that gives access to PostgreSQL's query parser, for turning SQL into a parse tree.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Python 99.0%
  • Shell 1.0%