Skip to content

Commit 0b220aa

Browse files
authored
Release v6.0.0 (#194)
* Feature/soql evaluator (#193) * evaluate * Evaluate * Evaluate * SOQL Evaluator * SOQLEvaluator_Test * SOQLEvaluator_Test * SOQLEvaluator_Test * SOQLEvaluator_Test * Refactoring * Caching improvements (#195) * Multiple conditions possibility * SOQLCache * ignore conditions * additionalAllowedConditionFields * toIdOf * Refactoring * Refactoring * Refactoring * Refactoring * query relationship fields support * Examples improvement * docusaurus update * documentation * documentation update * Documentation Update * Documentation * documentation * dark mode * documentation * soql cache documentation * Fix links * Documentation * links * Fix links * installation * documentation * documentation * documentation * fix link * SOQL_Cache code coverage * SOQLEvaluator_Test code coverage * SOQL_Test code coverage * Fix SOQLEvaluator_Test * documentation update
1 parent 19e8eca commit 0b220aa

File tree

88 files changed

+6916
-3113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+6916
-3113
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div align="center">
2-
<a href="https://nextjs.org">
2+
<a href="https://soql.beyondthecloud.dev">
33
<picture>
44
<source media="(prefers-color-scheme: dark)" srcset="https://soql.beyondthecloud.dev/img/logo.png">
55
<img alt="SOQL Lib logo" src="https://soql.beyondthecloud.dev/img/logo.png" height="98">
@@ -13,8 +13,6 @@
1313

1414
![Deploy to Scratch Org and run tests](https://github.com/beyond-the-cloud-dev/soql-lib/actions/workflows/ci.yml/badge.svg)
1515
[![codecov](https://codecov.io/gh/beyond-the-cloud-dev/soql-lib/branch/main/graph/badge.svg)](https://codecov.io/gh/beyond-the-cloud-dev/soql-lib)
16-
17-
1816
</div>
1917

2018
# Getting Started

force-app/main/default/classes/examples/ExampleController.cls

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ public with sharing class ExampleController {
99

1010
@AuraEnabled
1111
public static List<Contact> getContactsRelatedToAccount(Id accountId) {
12-
return SOQL_Contact.query().byAccountId(accountId).toList();
12+
return SOQL_Contact.query()
13+
.byAccountId(accountId)
14+
.with(Contact.Email, Contact.Title)
15+
.toList();
1316
}
1417

1518
@AuraEnabled
@@ -43,11 +46,19 @@ public with sharing class ExampleController {
4346

4447
@AuraEnabled
4548
public static List<Opportunity> getOpportunitiesRelatedToAccount(Id accountId) {
46-
return SOQL_Opportunity.query().byAccountId(accountId).toList();
49+
return SOQL_Opportunity.query()
50+
.byAccountId(accountId)
51+
.with(Opportunity.Name, Opportunity.StageName)
52+
.toList();
4753
}
4854

4955
@AuraEnabled
5056
public static Integer getOpportunityAmount(Id opportunityId) {
5157
return (Integer) SOQL_Opportunity.query().byId(opportunityId).toValueOf(Opportunity.Amount);
5258
}
59+
60+
@AuraEnabled
61+
public static List<Account> getAllAccount() {
62+
return SOQLEvaluator.of([SELECT Id, Name FROM Account WITH USER_MODE]).toList();
63+
}
5364
}

force-app/main/default/classes/examples/cached-selectors/SOQL_CachedOrgWideEmailAddress.cls

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ public without sharing class SOQL_CachedOrgWideEmailAddress extends SOQLCache im
1212
return SOQL.of(OrgWideEmailAddress.SObjectType);
1313
}
1414

15+
public override List<SObjectField> additionalAllowedConditionFields() {
16+
return new List<SObjectField>{ OrgWideEmailAddress.Address };
17+
}
18+
1519
public SOQL_CachedOrgWideEmailAddress byAddress(String address) {
1620
whereEqual(OrgWideEmailAddress.Address, address);
1721
return this;

force-app/main/default/classes/examples/cached-selectors/SOQL_CachedUser.cls

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ public without sharing class SOQL_CachedUser extends SOQLCache implements SOQLCa
1313
return SOQL.of(User.SObjectType).whereAre(SOQL.Filter.id().equal(UserInfo.getUserId()));
1414
}
1515

16+
public override List<SObjectField> additionalAllowedConditionFields() {
17+
return new List<SObjectField>{ User.Username };
18+
}
19+
1620
public SOQL_CachedUser byUsername(String username) {
1721
whereEqual(User.Username, username);
1822
return this;

force-app/main/default/classes/examples/standard-selectors/SOQL_Account.cls

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
public inherited sharing class SOQL_Account extends SOQL implements SOQL.Selector {
2-
public static final String MOCK_ID = 'SOQL_Account';
2+
@TestVisible
3+
private static final String MOCK_ID = 'SOQL_Account';
34

45
public static SOQL_Account query() {
56
return new SOQL_Account();

force-app/main/default/classes/examples/standard-selectors/SOQL_Contact.cls

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
public inherited sharing class SOQL_Contact extends SOQL implements SOQL.Selector {
2-
public static final String MOCK_ID = 'SOQL_Contact';
2+
@TestVisible
3+
private static final String MOCK_ID = 'SOQL_Contact';
34

45
public static SOQL_Contact query() {
56
return new SOQL_Contact();

force-app/main/default/classes/examples/standard-selectors/SOQL_Opportunity.cls

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
public inherited sharing class SOQL_Opportunity extends SOQL implements SOQL.Selector {
2-
public static final String MOCK_ID = 'SOQL_Opportunity';
2+
@TestVisible
3+
private static final String MOCK_ID = 'SOQL_Opportunity';
34

45
public static SOQL_Opportunity query() {
56
return new SOQL_Opportunity();

force-app/main/default/classes/main/cached-soql/CacheManager.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* - PropertyNamingConventions: It was intentional to make the lib more fluent and readable
88
* - FieldNamingConventions: It was intentional to make the lib more fluent and readable
99
**/
10-
@SuppressWarnings('PMD.CognitiveComplexity, PMD.PropertyNamingConventions, PMD.FieldNamingConventions')
10+
@SuppressWarnings('PMD.CognitiveComplexity,PMD.PropertyNamingConventions,PMD.FieldNamingConventions')
1111
public with sharing class CacheManager {
1212
public interface Cacheable {
1313
Boolean contains(String key);

0 commit comments

Comments
 (0)