psq

psqlparse

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

Showing:

Popularity

Downloads/wk

0

GitHub Stars

128

Maintenance

Last Commit

2yrs ago

Contributors

19

Package

Dependencies

0

License

BSD

Categories

Readme

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']

tables is only available from version 1.0rc1

Development

  1. Update dependencies
git submodule update --init
  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

Maintainers

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100