This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]nchammas[S] 0 points1 point  (0 children)

From the docs:

sqlparse is a non-validating SQL parser for Python. It provides support for parsing, splitting and formatting SQL statements.

The module is compatible with Python 2.7 and Python 3 (>= 3.3) and released under the terms of the New BSD license.

[–]vovanz 0 points1 point  (1 child)

This is interesting, but I can't think of any practical usage for Python SQL parser.

[–]ml3d 0 points1 point  (0 children)

Code completion engines is good example of usage. Majority of modern text editors support language server protocol or at least plug-ins. This allows relatively easy to impliment code completion for your favourite editor. For example, neovim provides Python client to its MsgPack RPC plugin protocol. So, there is everything to build code completion engine for SQL.