Skip to main content

SOQL Lib

Everything you need to build SOQL queries in Salesforce APEX.

What's in SOQL Lib?

The SOQL Lib provides functional constructs for SOQL queries in Apex.

Dynamic Query Builder

Build SOQL queries dynamically with fluent API. No more string concatenation or massive selector classes with hundreds of methods.

Advanced Caching System

Cache records in Apex transactions, Session Cache, or Org Cache for dramatic performance improvements.

Built-in Security Controls

Enforce field-level security and sharing rules with WITH USER_MODE, WITH SYSTEM_MODE, and sharing settings by default.

Comprehensive Testing Support

Mock SOQL results in unit tests without complex test data setup. Perfect for external objects and custom metadata.

Result Transformation

Transform query results easily with built-in methods: toMap(), toIds(), toValuesOf(), and many more powerful utilities.

Lightweight Selectors

Keep selector classes minimal and focused. Define business-specific queries inline where they're needed.