alexfu / SQLiteQueryBuilder

A library that provides a simple API for building SQLite query statements in Java.
MIT License
70 stars 21 forks source link

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...

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'
}