# QueryBuilder: How I wrote a runtime SQL query generator for an Android app

DevFeed: [QueryBuilder: How I wrote a runtime SQL query generator for an Android app](<https://devfeed.tech/articles/querybuilder-how-i-wrote-a-runtime-sql-query-generator-for-an-android-app-25682.md>)

Original publisher: [Read original article](<https://blog.sanskar10100.dev/querybuilder-how-i-wrote-a-runtime-sql-query-generator-for-an-android-app>)

Author: Sanskar Agrawal

Published: 2022-02-07T12:05:01Z

Content type: tutorial

Language: en

Sources: [Sanskar's Stuff](<https://devfeed.tech/sources/sanskar-s-stuff.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Object-relational mapping](<https://devfeed.tech/topics/orm.md>), [SQLite](<https://devfeed.tech/topics/sqlite.md>), [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [coding](<https://devfeed.tech/topics/coding.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [app-development](<https://devfeed.tech/tags/app-development.md>), [coding](<https://devfeed.tech/tags/coding.md>), [database](<https://devfeed.tech/tags/database.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [orm](<https://devfeed.tech/tags/orm.md>), [room](<https://devfeed.tech/tags/room.md>), [sorting](<https://devfeed.tech/tags/sorting.md>), [sql](<https://devfeed.tech/tags/sql.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>)

## AI overview

A developer explains how an Android app called Transactions uses Room ORM over SQLite and Kotlin Flow, then describes the need for incremental sorting and filtering. The article compares filtering Kotlin lists with writing custom DAO methods for every query combination, motivating a runtime SQL query generator.

## Source excerpt

I've been building an app called Transactions for some time. As the name suggests, Transactions offers you the capability to track your income and expenses made through cash or digital mediums. I mostly wrote it for my personal use, but it caught on ...