<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Adrián Bukros on Medium]]></title>
        <description><![CDATA[Stories by Adrián Bukros on Medium]]></description>
        <link>https://medium.com/@adrianbukros?source=rss-5843781daa9f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*qutvw6HmSuYF6m5y.jpg</url>
            <title>Stories by Adrián Bukros on Medium</title>
            <link>https://medium.com/@adrianbukros?source=rss-5843781daa9f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 02:53:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adrianbukros/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Requery — My favorite Android ORM library]]></title>
            <link>https://medium.com/we-are-makery/requery-my-favorite-android-orm-library-c8a9b5d2851?source=rss-5843781daa9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8a9b5d2851</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Adrián Bukros]]></dc:creator>
            <pubDate>Fri, 04 Mar 2016 13:43:21 GMT</pubDate>
            <atom:updated>2016-03-04T14:20:14.190Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ixsW39_MEy_Co_fW2bS7gQ.jpeg" /><figcaption><a href="https://unsplash.com/photos/xiTFENI0dMY">https://unsplash.com/photos/xiTFENI0dMY</a></figcaption></figure><h4>About Requery</h4><p>There are lot of libraries that help you store your data in SQLite database on Android, but Requery makes it a lot more simple. It’s a light but powerful ORM and SQL query generator that supports RxJava, and helps you keep boilerplate code to a minimum. The library itself was built by <a href="https://github.com/npurushe"><strong>Nikhil Purushe</strong>.</a></p><h4>Using Requery</h4><p>The follwing example is written in Kotlin.</p><p>First step is to add the lib to you project by modifying build.gradle:</p><pre>dependencies {<br>  compile ‘io.requery:requery:1.0-SNAPSHOT’<br>  compile ‘io.requery:requery-android:1.0-SNAPSHOT’<br>  kapt ‘io.requery:requery-processor:1.0-SNAPSHOT’<br>}</pre><p>Setup the Kotling Annotation Processor so you can use the generated classes in your code:</p><pre>kapt {<br>  generateStubs = <strong>true<br></strong>}</pre><p>You also need to add a custom repository location. Requery is in development phase so only snapshot version is available:</p><pre>repositories {<br>  jcenter()<br>  maven { url ‘http://oss.jfrog.org/artifactory/oss-snapshot-local&#39;}<br>}</pre><p>Now you can use Requery. Add these lines to your Application class or your dependency injection code to access the SingleEntityStore anywhere from your app.</p><pre><strong>val </strong>source = DatabaseSource(<strong>context</strong>, <strong>entityModel</strong>, <strong>dbVersion</strong>);<br><strong>val </strong>dataStore = RxSupport.toReactiveStore(<br>  EntityDataStore&lt;Persistable&gt;(source.<strong>configuration</strong>)<br>);</pre><p>You can use the auto generated <strong>Model.DEFAULT</strong> for the <strong>entityModel </strong>parameter, which is created after you’ve annotated a class or interface with the necessary requery annotations. Eg. for a simple user class:</p><pre>@Entity<br><strong>public abstract class </strong>User {<br>  @Key @Generated<br>  <strong>int id</strong>;<br>  @Index(name=<strong>”name”</strong>)<br>  String <strong>name</strong>;<br>}</pre><p>(Currently only Java classes supported for model definition.)</p><p>This makes the framework generate the UserEntity class which can be used for further actions, like insert:</p><pre><strong>val </strong>user = UserEntity()<br>user.setName(<strong>“XY”</strong>)</pre><pre><strong>dataStore</strong>.insert(user)<br> .toObservable()<br> .subscribeOn(Schedulers.io())<br> .observeOn(AndroidSchedulers.mainThread())<br> .subscribe{ user -&gt;<br>    Timber.d(<strong>“User inserted: “</strong>+user.getId()+<strong>” “</strong>+user .getName())<br>}</pre><p>Or select:</p><pre><strong>dataStore</strong>.select(UserEntity::<strong>class</strong>.<em>java</em>)<br> .get()<br> .toObservable()<br> .subscribeOn(Schedulers.io())<br> .observeOn(AndroidSchedulers.mainThread())<br> .subscribe{ user -&gt;<br>    Timber.d(<strong>“User from DB: “</strong>+user.getId()+<strong>” “</strong>+user .getName())<br>}</pre><h4>Summary</h4><p>So Requery is a promising solution for persisting your data on Android, taking a lot of weight off of developers. Checkout the project GitHub repo <a href="https://github.com/requery/requery">here</a>, and my example app <a href="https://github.com/wearemakery/requery-android-example">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8a9b5d2851" width="1" height="1" alt=""><hr><p><a href="https://medium.com/we-are-makery/requery-my-favorite-android-orm-library-c8a9b5d2851">Requery — My favorite Android ORM library</a> was originally published in <a href="https://medium.com/we-are-makery">MAKERS channel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>