You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/docs/basic-features.md
+125-1Lines changed: 125 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,130 @@ SOQL.of(Account.SObjectType)
46
46
}
47
47
```
48
48
49
+
50
+
## Minimalistic Selectors
51
+
52
+
The selector constructor maintains default configurations such as default fields, sharing mode, and field-level security settings. Only essential, reusable methods are maintained in the selector class, with each method returning an instance of the selector to enable method chaining.
53
+
54
+
Additional fields, complex conditions, ordering, limits, and other SOQL clauses can be built dynamically where they are needed (for example, in controller methods), keeping the selector focused on core functionality.
55
+
56
+
```apex
57
+
public inherited sharing class SOQL_Account extends SOQL implements SOQL.Selector {
58
+
public static final String MOCK_ID = 'SOQL_Account';
SOQL Lib selectors are designed to include only a minimal set of default fields in their constructor, typically just essential identifiers and commonly used fields. This approach significantly improves query performance and promotes reusability by avoiding unnecessary data retrieval.
121
+
122
+
**Design Philosophy:**
123
+
The selector constructor defines the minimum viable field set that covers the majority of use cases. Additional fields are added dynamically where they are actually needed, following the principle of "pull only what you need, when you need it."
124
+
125
+
```apex
126
+
public inherited sharing class SOQL_Contact extends SOQL implements SOQL.Selector {
0 commit comments