sqlparse icon indicating copy to clipboard operation
sqlparse copied to clipboard

Add sql_keywords option (fixes #384)

Open watoo-tech opened this issue 5 years ago • 3 comments

You may pass a dict with a list of specific dialect keywords to consider.

Default behavior is to consider all supported dialects (oracle, plpgsql, hql).

keywords.keywords_map(*dialects) helper is provided to merge individual dialect maps.

You may use this to restrict keyword matching to a specific subset of dialects i.e. keywords_map(KEYWORDS_HQL,KEYWORDS_PLPGSQL)

See test_regression.py:test_issue384()

watoo-tech avatar Jul 26 '19 10:07 watoo-tech

This replaces PR #500 with a new one using its own branch instead of master.

watoo-tech avatar Jul 26 '19 11:07 watoo-tech

@andialbrecht - Is there anything else this PR needs to be merged? We'd like to use sqlparse for Snowflake and this would be really helpful for adding the additional dialect keywords.

ajbosco avatar Oct 23 '19 12:10 ajbosco

What's the status on this PR? I would love to use this library to parse our BigQuery SQL.

Is there anything I can do to help? @andialbrecht

ericxiao251 avatar Sep 26 '20 21:09 ericxiao251