function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mel LisauMel Lisau 

How can i parse Salesforce SOQL query using the TSQLStatementReader.ParseStatements?

How can i parse SOQL query using the TSQLStatementReader.ParseStatements ?
I have a SOQL query :
var query = select id, Order.Id, Order.Contract.Id, Order.Contract.Account.Id, Order.Contract.Account.Owner.Id from OrderItem
and I am trying to parse this into columns by using the following:
var statement = TSQLStatementReader.ParseStatements(query.Replace("\n", " ").Replace("\r", " "));

But if i debug there is nothing in the From property of the object, it seems to be going to the Group By and the Select property is null as well ?
How can i do the parsing or is there a SOQLParser class ?
SwethaSwetha (Salesforce Developers) 
HI Mel,
I see you also posted on https://stackoverflow.com/questions/72514024/how-can-i-parse-salesforce-soql-query-using-the-tsqlstatementreader-parsestateme 

As the query is more of .net related than Salesforce's the Salesforce community might not be able to suggest.

Related posts: https://salesforce.stackexchange.com/questions/313036/soql-parser-implementation-in-apex
https://salesforce.stackexchange.com/questions/40432/better-soql-query-or-ability-to-parse-results-by-field

Please consider closing the thread by marking answer as best.Thank you