I’m excited to announce the release of ApexEloquent v1.0, an open-source ORM framework for Salesforce Apex (Apache 2.0).
Inspired by Laravel’s Eloquent, it’s designed specifically for Salesforce developers to make working with SOQL and relationships easier, safer, and fully testable.
Why ApexEloquent?
Many Salesforce developers face these common pain points:
- Verbose and brittle SOQL queries
- Complex parent/child/many-to-many relationship handling
- Slow and fragile database-dependent unit tests
ApexEloquent solves these by providing:
- Fluent & safe query construction – write queries like natural sentences
- Effortless relationship handling – access parent, child, and junction objects intuitively
-
True DB-free unit testing –
MockEloquent
lets you run fast, isolated tests without any DML or SOQL
Quick Example
// Fetch Opportunities with Amount > 100,000
Scribe scribe = Scribe.source(Opportunity.getSObjectType())
.fields(new List<String>{'Id','Name','Amount'})
.whereGreaterThan('Amount', 100000);
List<IEntry> opps = (new Eloquent()).get(scribe);
With MockEloquent
, the same queries can be tested without touching the database, making your unit tests faster and more reliable.
Learn More
- GitHub: ApexEloquent
- Developer Guide: KrileWorks.com
I’d love to hear feedback from the community!
Have you tried similar ORM approaches in Apex? How do you handle database-independent testing in your projects?
Top comments (0)