Skip to main content

Debug

public inherited sharing class QS_Account {

public static QS Selector {
get {
return QS.of(Account.sObjectType)
.fields(new List<sObjectField>{
Account.Id,
Account.Name
});
}
}
}

public with sharing class MyController {

public static List<Account> getAccounts() {
return (List<Account>) QS_Account.Selector
.fields(new List<sObjectField>{
Account.BillingCity,
Account.BillingCountry,
Account.BillingCountryCode
})
.whereAre(QS.ConditionsGroup
.add(QS.Condition.field(Account.Id).equal('0013V00000WNCw4QAH'))
.add(QS.Condition.field(Account.Name).likeAnyBoth('Test'))
.order('1 OR 2')
)
.preview()
.asList();
}
}

You will see in debug logs:

============ Query Preview ============
SELECT Name, AccountNumber, BillingCity, BillingCountry, BillingCountryCode
FROM Account
WHERE ((Id = :v1 OR Name LIKE :v2))
=======================================

============ Query Binding ============
{
"v2" : "%Test%",
"v1" : "0013V00000WNCw4QAH"
}
=======================================