Skip to content
This repository has been archived by the owner. It is now read-only.
A library that provides a simple API for building SQLite query statements in Java.
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config/checkstyle Fixes #26 Jul 7, 2015
gradle/wrapper Initial commit Dec 26, 2014
src Implement chainable AND clause Mar 4, 2016
.gitignore Updates the ignore list. Mar 28, 2015
.travis.yml Update travis file Jan 15, 2016
CHANGELOG.md Update CHANGELOG Jun 16, 2016
LICENSE.txt Add license Apr 2, 2016
README.md Merge branch 'develop' Jun 16, 2016
build.gradle Bump version Jun 16, 2016
gradlew Initial commit Dec 26, 2014
gradlew.bat Initial commit Dec 26, 2014
settings.gradle Initial commit Dec 26, 2014

README.md

SQLiteQueryBuilder

Build Status Coverage Status Join the chat at https://gitter.im/alexfu/SQLiteQueryBuilder

This project is aimed at providing a simple API to build SQLite query statements. This library does nothing but build statements; it's not an ORM. The API syntax is inspired from the jOOQ library.

Currently, SQLiteQueryBuilder is under active development so you may find some features missing. If this is the case, please file an issue or open a pull request.

Motivation

Although this project is written in Java and bears no dependencies to external frameworks (so far), it is/was developed specifically to be used on the Android platform. There are a few reasons why I started this project...

  • Building SQLite statements in pure Java can be cumbersome and very unreadable at times
  • Androids own SQLiteQueryBuilder is also cumbersome to use at times.
  • Although the jOOQ library has a great API for building SQL statements, it comes with an entire suite of tools to build statements, connect to databases, write/read models to/from databases, etc. Due to the current nature of Dalvik (Androids application VM), there is a 64k method reference limit. jOOQ can contain over 10,000 referenced methods when in use. This may not seem like much in comparison to the limit, but if you consider other large libraries commonly used (such as Guava and Google Play Services), hitting that 64k limit becomes much easier.

Usage

String sql = SQLiteQueryBuilder
	.select("*")
	.from("accounts")
	.where("id = 1")
	.toString();

You can view more examples in the src/test/java folder.

To use this library, add the follow to your gradle build:

repositories {
    maven {
        url "https://jitpack.io"
    }
}

dependencies {
    compile 'com.github.alexfu:SQLiteQueryBuilder:0.1.1'
}
You can’t perform that action at this time.