CONTRIBUTORS WANTED!!
pip install python-soql-parser
or, with poetry
poetry add python-soql-parser
from python_soql_parser import parse
parse_result = parse("SELECT Id FROM Account")
where parse_result
is a ParseResults object from pyparsing.
- Subqueries (e.g.,
SELECT Name, (SELECT LastName FROM Contacts) FROM Account
) - Aggregate queries
- Some SOQL specific WHERE-clause tokens like Polymorphic Relationship Fields. Date literals are supported (e.g.,
LAST_N_DAYS:<integer>
).
These are either partially supported or weakly supported
- Related attributes (e.g.,
SELECT Id, Account.Name FROM Contact
). The object name is not yet parsed out on its own. This will simply parse out"Account.Name"
A lot of work remains to be done. Practically no SOQL-specific features are supported as of yet. If you want to contribute, just open a PR! (and add a test for your new feature)
First install poetry. Afterwards, to install the dependencies, run
poetry install
Simply execute
pytest
Please sort imports with isort
and format the code with black
(in that order).