Well Salesforce Database.query has a unique feature that allows us to append the bind variable inside the Query string. All the variables that is included in the query string automatically calculated and are replaced by appropriate values.
For Example
String accName ='Test Account';
String queryStr = 'SELECT Id FROM Account WHERE Name=:accName';
List<Account> accList = Database.query(queryStr);
The above code works well. Was wondering if there is a method or API that is exposed SF using which we can get the compiled string or the generated query.
I know this can be done by creating template and using String.format() to generate the string Or can use a String with appended variables. Just wondering if it is possible to get the compiled string?