Help, python.reddit! Seeking a SQL parser
I'm looking for a SQL parser I can use from Python that will give me a parse tree to work with. Ideally, I'd do something like
parse_tree = parser.parse (sql)
and have a nice syntax tree I can walk. I'd like to support a large subset of ANSI SQL, but, at a minimum, I'd like to be able to support CREATE, UPDATE, DROP, SELECT (with WHERE clauses), and INSERT.
Thanks for any help!
Posted Aug 11, 2009, 9:00 AM UTC
43
There you go: http://code.google.com/p/python-sqlparse/
Next time ask on stackoverflow :)
or, you know… http://tinyurl.com/ne9ghe
I really enjoy googling something, and finding that the first results are all "rtfm", look it up, search the forum, etc. LMGTFY is a clever answer to a private question, but posting it as a public answer makes Google less efficient.