<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: krile 136cm</title>
    <description>The latest articles on DEV Community by krile 136cm (@krile_136cm_dee71f4d3fe7d).</description>
    <link>https://dev.to/krile_136cm_dee71f4d3fe7d</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3497425%2F2f8c2b06-3ca0-4cff-9b1d-72674f659e04.jpg</url>
      <title>DEV Community: krile 136cm</title>
      <link>https://dev.to/krile_136cm_dee71f4d3fe7d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/krile_136cm_dee71f4d3fe7d"/>
    <language>en</language>
    <item>
      <title>ApexEloquent v1.0 – An Apex ORM Framework with True DB-Free Unit Testing</title>
      <dc:creator>krile 136cm</dc:creator>
      <pubDate>Fri, 12 Sep 2025 12:31:06 +0000</pubDate>
      <link>https://dev.to/krile_136cm_dee71f4d3fe7d/apexeloquent-v10-an-apex-orm-framework-with-true-db-free-unit-testing-20kj</link>
      <guid>https://dev.to/krile_136cm_dee71f4d3fe7d/apexeloquent-v10-an-apex-orm-framework-with-true-db-free-unit-testing-20kj</guid>
      <description>&lt;p&gt;I’m excited to announce the release of &lt;strong&gt;ApexEloquent v1.0&lt;/strong&gt;, an open-source ORM framework for Salesforce Apex (Apache 2.0).&lt;br&gt;&lt;br&gt;
Inspired by Laravel’s Eloquent, it’s designed specifically for Salesforce developers to make working with SOQL and relationships easier, safer, and fully testable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why ApexEloquent?
&lt;/h2&gt;

&lt;p&gt;Many Salesforce developers face these common pain points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verbose and brittle SOQL queries
&lt;/li&gt;
&lt;li&gt;Complex parent/child/many-to-many relationship handling
&lt;/li&gt;
&lt;li&gt;Slow and fragile database-dependent unit tests
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ApexEloquent solves these by providing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fluent &amp;amp; safe query construction&lt;/strong&gt; – write queries like natural sentences
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Effortless relationship handling&lt;/strong&gt; – access parent, child, and junction objects intuitively
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;True DB-free unit testing&lt;/strong&gt; – &lt;code&gt;MockEloquent&lt;/code&gt; lets you run fast, isolated tests without any DML or SOQL
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Quick Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apex"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Fetch Opportunities with Amount &amp;gt; 100,000&lt;/span&gt;
&lt;span class="n"&gt;Scribe&lt;/span&gt; &lt;span class="n"&gt;scribe&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Scribe&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;source&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Opportunity&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getSObjectType&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s2"&gt;Id'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s2"&gt;Name'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s2"&gt;Amount'&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;whereGreaterThan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s2"&gt;Amount'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;IEntry&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;opps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Eloquent&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;scribe&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;code&gt;MockEloquent&lt;/code&gt;, the same queries can be tested &lt;strong&gt;without touching the database&lt;/strong&gt;, making your unit tests faster and more reliable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn More
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/krile136/ApexEloquent" rel="noopener noreferrer"&gt;ApexEloquent&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Developer Guide: &lt;a href="https://krileworks.com/" rel="noopener noreferrer"&gt;KrileWorks.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’d love to hear feedback from the community!&lt;br&gt;&lt;br&gt;
Have you tried similar ORM approaches in Apex? How do you handle database-independent testing in your projects?&lt;/p&gt;

</description>
      <category>testing</category>
      <category>opensource</category>
      <category>salesforce</category>
      <category>apex</category>
    </item>
  </channel>
</rss>
