Add initial implementation of calls tab behind a feature flag.

This commit is contained in:
Alex Hart
2023-03-15 12:52:18 -03:00
committed by Greyson Parrelli
parent d1373d2767
commit 88de0f21e7
33 changed files with 1464 additions and 63 deletions

View File

@@ -125,6 +125,10 @@ class SelectBuilderPart3(
return SelectBuilderPart4b(db, columns, tableName, where, whereArgs, limit)
}
fun limit(limit: Int, offset: Int): SelectBuilderPart4b {
return SelectBuilderPart4b(db, columns, tableName, where, whereArgs, "$offset,$limit")
}
fun run(): Cursor {
return db.query(
SupportSQLiteQueryBuilder
@@ -152,6 +156,10 @@ class SelectBuilderPart4a(
return SelectBuilderPart5(db, columns, tableName, where, whereArgs, orderBy, limit)
}
fun limit(limit: Int, offset: Int): SelectBuilderPart5 {
return SelectBuilderPart5(db, columns, tableName, where, whereArgs, orderBy, "$offset,$limit")
}
fun run(): Cursor {
return db.query(
SupportSQLiteQueryBuilder

View File

@@ -394,5 +394,15 @@ object SqlUtil {
return Query(query, args.toTypedArray())
}
class Query(val where: String, val whereArgs: Array<String>)
class Query(val where: String, val whereArgs: Array<String>) {
infix fun and(other: Query): Query {
return if (where.isNotEmpty() && other.where.isNotEmpty()) {
Query("($where) AND (${other.where})", whereArgs + other.whereArgs)
} else if (where.isNotEmpty()) {
this
} else {
other
}
}
}
}