Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions force-app/main/default/classes/cached-soql/SOQLCache.cls
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2025 Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev)
* Licensed under the MIT License (https://github.com/beyond-the-cloud-dev/soql-lib/blob/main/LICENSE)
*
* v6.2.0
* v6.3.0
*
* PMD False Positives:
* - ExcessivePublicCount: It is a library class and exposes all necessary methods to construct a query
Expand All @@ -15,20 +15,20 @@
* - ExcessiveParameterList: Make methods similar to native SOQL
**/
@SuppressWarnings('PMD.ExcessivePublicCount,PMD.ExcessiveClassLength,PMD.CyclomaticComplexity,PMD.CognitiveComplexity,PMD.PropertyNamingConventions,PMD.FieldDeclarationsShouldBeAtStart,PMD.ApexDoc,PMD.ExcessiveParameterList')
public virtual inherited sharing class SOQLCache implements Cacheable {
public interface Selector {
global virtual inherited sharing class SOQLCache implements Cacheable {
global interface Selector {
Cacheable query();
}

public static Cacheable of(SObjectType ofObject) {
global static Cacheable of(SObjectType ofObject) {
return new SOQLCache(ofObject);
}

public static Cacheable of(String ofObject) {
global static Cacheable of(String ofObject) {
return new SOQLCache(ofObject);
}

public interface Cacheable {
global interface Cacheable {
// CONFIG
Cacheable cacheInApexTransaction();
Cacheable cacheInOrgCache();
Expand Down Expand Up @@ -75,13 +75,13 @@ public virtual inherited sharing class SOQLCache implements Cacheable {
return null;
}

public virtual List<SObjectField> additionalAllowedConditionFields() {
protected virtual List<SObjectField> additionalAllowedConditionFields() {
return new List<SObjectField>();
}

// Mocking

public interface Mockable {
global interface Mockable {
// SObject
void thenReturn(SObject record);
}
Expand All @@ -95,7 +95,7 @@ public virtual inherited sharing class SOQLCache implements Cacheable {
return SOQLCache.queryIdToMock.get(mockId).get(SOQLCache.queryIdToMock.get(mockId).size() - 1);
}

public static void removeFromCache(List<SObject> records) {
global static void removeFromCache(List<SObject> records) {
if (records.isEmpty()) {
return;
}
Expand Down Expand Up @@ -124,8 +124,8 @@ public virtual inherited sharing class SOQLCache implements Cacheable {
private Executor executor;
private Cache cache;

public SOQL.Queryable initialQuery = null;
public SOQL.Queryable currentQuery = null;
private SOQL.Queryable initialQuery = null;
private SOQL.Queryable currentQuery = null;

protected SOQLCache(SObjectType ofObject) {
this(ofObject.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2025 Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev)
* Licensed under the MIT License (https://github.com/beyond-the-cloud-dev/soql-lib/blob/main/LICENSE)
*
* v6.2.0
* v6.3.0
*
* PMD False Positives:
* - CyclomaticComplexity: It is a library and we tried to put everything into ONE test class
Expand Down
10 changes: 5 additions & 5 deletions force-app/main/default/classes/soql-evaluator/SOQLEvaluator.cls
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
* Copyright (c) 2025 Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev)
* Licensed under the MIT License (https://github.com/beyond-the-cloud-dev/soql-lib/blob/main/LICENSE)
*
* v6.2.0
* v6.3.0
*
* PMD False Positives:
* - CognitiveComplexity: It is a library and we tried to put everything into ONE class
* - ApexDoc: Variable names are self-documented.
**/
@SuppressWarnings('PMD.CognitiveComplexity,PMD.ApexDoc')
public inherited sharing class SOQLEvaluator {
public static SObjectEvaluable of(List<SObject> staticQueryRecords) {
global inherited sharing class SOQLEvaluator {
global static SObjectEvaluable of(List<SObject> staticQueryRecords) {
return new SObjectEvaluator(staticQueryRecords);
}

public interface SObjectEvaluable {
global interface SObjectEvaluable {
// FIELD-LEVEL SECURITY
SObjectEvaluable stripInaccessible();
SObjectEvaluable stripInaccessible(AccessType accessType);
Expand All @@ -40,7 +40,7 @@ public inherited sharing class SOQLEvaluator {
Map<String, List<String>> toAggregatedMap(SObjectField keyField, String relationshipName, SObjectField targetKeyField);
}

public interface Mockable {
global interface Mockable {
// SObject
Mockable thenReturn(SObject record);
Mockable thenReturn(List<SObject> records);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2025 Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev)
* Licensed under the MIT License (https://github.com/beyond-the-cloud-dev/soql-lib/blob/main/LICENSE)
*
* v6.2.0
* v6.3.0
*
* PMD False Positives:
* - CyclomaticComplexity: It is a library and we tried to put everything into ONE test class
Expand Down
46 changes: 23 additions & 23 deletions force-app/main/default/classes/standard-soql/SOQL.cls
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2025 Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev)
* Licensed under the MIT License (https://github.com/beyond-the-cloud-dev/soql-lib/blob/main/LICENSE)
*
* v6.2.0
* v6.3.0
*
* PMD False Positives:
* - ExcessivePublicCount: It is a library class and exposes all necessary methods to construct a query
Expand All @@ -17,20 +17,20 @@
* - NcssTypeCount: It is a library and we tried to put everything into ONE class
**/
@SuppressWarnings('PMD.ExcessivePublicCount,PMD.ExcessiveClassLength,PMD.FieldNamingConventions,PMD.CyclomaticComplexity,PMD.CognitiveComplexity,PMD.PropertyNamingConventions,PMD.FieldDeclarationsShouldBeAtStart,PMD.ApexDoc,PMD.ExcessiveParameterList,PMD.NcssTypeCount')
public virtual inherited sharing class SOQL implements Queryable {
public interface Selector {
global virtual inherited sharing class SOQL implements Queryable {
global interface Selector {
Queryable query();
}

public static Queryable of(SObjectType ofObject) {
global static Queryable of(SObjectType ofObject) {
return new SOQL(ofObject);
}

public static Queryable of(String ofObject) {
global static Queryable of(String ofObject) {
return new SOQL(ofObject);
}

public interface Queryable {
global interface Queryable {
// SELECT
Queryable with(SObjectField field);
Queryable with(SObjectField field1, SObjectField field2);
Expand Down Expand Up @@ -194,7 +194,7 @@ public virtual inherited sharing class SOQL implements Queryable {
Map<String, Object> binding();
}

public interface SubQuery {
global interface SubQuery {
SubQuery of(String ofObject);
// SELECT
SubQuery with(SObjectField field);
Expand Down Expand Up @@ -227,7 +227,7 @@ public virtual inherited sharing class SOQL implements Queryable {
String getChildRelationshipName();
}

public interface FilterGroup {
global interface FilterGroup {
// ADD CONDITION
FilterGroup add(FilterGroup filterGroup);
FilterGroup add(Filter filter);
Expand All @@ -243,7 +243,7 @@ public virtual inherited sharing class SOQL implements Queryable {
Boolean hasValues();
}

public interface Filter {
global interface Filter {
// FIELDS
Filter id();
Filter recordType();
Expand Down Expand Up @@ -286,7 +286,7 @@ public virtual inherited sharing class SOQL implements Queryable {
Boolean hasValue();
}

public interface InnerJoin {
global interface InnerJoin {
InnerJoin of(SObjectType ofObject);
// SELECT
InnerJoin with(SObjectField field);
Expand All @@ -295,7 +295,7 @@ public virtual inherited sharing class SOQL implements Queryable {
InnerJoin whereAre(Filter filter);
}

public interface HavingFilterGroup {
global interface HavingFilterGroup {
// ADD CONDITION
HavingFilterGroup add(HavingFilterGroup havingFilterGroup);
HavingFilterGroup add(HavingFilter havingFilter);
Expand All @@ -307,7 +307,7 @@ public virtual inherited sharing class SOQL implements Queryable {
Boolean hasValues();
}

public interface HavingFilter {
global interface HavingFilter {
// FIELDS
HavingFilter with(SObjectField field);
HavingFilter with(String field);
Expand Down Expand Up @@ -342,11 +342,11 @@ public virtual inherited sharing class SOQL implements Queryable {
Boolean hasValue();
}

public interface DataCategoryFilterGroup {
global interface DataCategoryFilterGroup {
DataCategoryFilterGroup add(DataCategoryFilter dataCategoryFilter);
}

public interface DataCategoryFilter {
global interface DataCategoryFilter {
// FIELDS
DataCategoryFilter with(String field);
// COMPARATORS
Expand All @@ -362,36 +362,36 @@ public virtual inherited sharing class SOQL implements Queryable {
Boolean hasValue();
}

public interface AggregateResultProxy {
global interface AggregateResultProxy {
Object get(String field);
Map<String, Object> getPopulatedFieldsAsMap();
}

public static SubQuery SubQuery {
global static SubQuery SubQuery {
get { return new SoqlSubQuery(); }
}

public static FilterGroup FilterGroup {
global static FilterGroup FilterGroup {
get { return new SoqlFilterGroup(); }
}

public static Filter Filter {
global static Filter Filter {
get { return new SoqlFilter(); }
}

public static InnerJoin InnerJoin {
global static InnerJoin InnerJoin {
get { return new SoqlJoinQuery(); }
}

public static HavingFilterGroup HavingFilterGroup {
global static HavingFilterGroup HavingFilterGroup {
get { return new SoqlHavingFilterGroup(); }
}

public static HavingFilter HavingFilter {
global static HavingFilter HavingFilter {
get { return new SoqlHavingFilter(); }
}

public static DataCategoryFilter DataCategoryFilter {
global static DataCategoryFilter DataCategoryFilter {
get { return new SoqlDataCategoryFilter(); }
}

Expand All @@ -408,7 +408,7 @@ public virtual inherited sharing class SOQL implements Queryable {

public static RandomIdGenerator IdGenerator = new RandomIdGenerator();

public interface Mockable {
global interface Mockable {
// SObject
Mockable thenReturn(SObject record);
Mockable thenReturn(List<SObject> records);
Expand Down
2 changes: 1 addition & 1 deletion force-app/main/default/classes/standard-soql/SOQL_Test.cls
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2025 Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev)
* Licensed under the MIT License (https://github.com/beyond-the-cloud-dev/soql-lib/blob/main/LICENSE)
*
* v6.2.0
* v6.3.0
*
* PMD False Positives:
* - CyclomaticComplexity: It is a library and we tried to put everything into ONE test class
Expand Down
9 changes: 5 additions & 4 deletions sfdx-project.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"packageDirectories": [
{
"versionName": "SOQL Lib 6.3.0",
"versionNumber": "6.3.0.NEXT",
"versionName": "SOQL Lib 6.4.0",
"versionNumber": "6.4.0.NEXT",
"path": "force-app",
"default": true,
"package": "SOQL Lib",
Expand All @@ -20,6 +20,7 @@
"packageAliases": {
"SOQL Lib": "0HoP6000000010vKAA",
"SOQL [email protected]": "04tP60000023Vm5IAE",
"SOQL [email protected]": "04tP60000023VnhIAE"
"SOQL [email protected]": "04tP60000023VnhIAE",
"SOQL [email protected]": "04tP60000025mHNIAY"
}
}
}
6 changes: 3 additions & 3 deletions website/docs/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ sidebar_position: 20

Install the SOQL Lib unlocked package with `btcdev` namespace to your Salesforce environment:

`/packaging/installPackage.apexp?p0=04tP60000023VnhIAE`
`/packaging/installPackage.apexp?p0=04tP60000025mHNIAY`

<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04tP60000023VnhIAE" target="_blank" style={{display: 'inline-block', backgroundColor: '#1976d2', color: 'white', padding: '10px 20px', textDecoration: 'none', borderRadius: '4px', marginRight: '10px'}}>
<a href="https://test.salesforce.com/packaging/installPackage.apexp?p0=04tP60000025mHNIAY" target="_blank" style={{display: 'inline-block', backgroundColor: '#1976d2', color: 'white', padding: '10px 20px', textDecoration: 'none', borderRadius: '4px', marginRight: '10px'}}>
<p style={{margin: '0px'}}>Install on Sandbox</p>
</a>

<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04tP60000023VnhIAE" target="_blank" style={{display: 'inline-block', backgroundColor: '#d32f2f', color: 'white', padding: '10px 20px', textDecoration: 'none', borderRadius: '4px'}}>
<a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04tP60000025mHNIAY" target="_blank" style={{display: 'inline-block', backgroundColor: '#d32f2f', color: 'white', padding: '10px 20px', textDecoration: 'none', borderRadius: '4px'}}>
<p style={{margin: '0px'}}>Install on Production</p>
</a>

Expand Down