You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use a io.requery:requery dependency, the following query:
val sumInNativeCurrency:Long?=
data.select(
NamedNumericExpression.ofLong("t_native.value").sum().`as`("native_sum")
)
.from(
data
.select(Operation.VALUE.`as`("value"))
.join(ExchangeRate::class.java)
.on(ExchangeRate.CURRENCY_ID.eq(currencyId))
.and(ExchangeRate.ID.eq(Operation.EXCHANGE_RATE_ID))
.where(Operation.ACCOUNT_ID.eq(accountId))
.`as`("t_native")
)
.get().first().get("native_sum")
where data is ReactiveEntityStore
Generates the following SQL:
selectsum(t_native.value) as native_sum from (selecta._valueas value from operation a inner join exchange_rate b onb.currency_id= ? andb.id=a.exchange_rate_idwherea.account_id= ?) t_native
But when I use io.requery:requery-kotlin dependency with minor changes (in the JOIN clause):
val sumInNativeCurrency:Long?=
data.select(
NamedNumericExpression.ofLong("t_native.value").sum().`as`("native_sum")
)
.from(
data
.select(Operation.VALUE.`as`("value"))
.join(ExchangeRate::class)
.on(ExchangeRate.CURRENCY_ID.eq(currencyId))
.and(ExchangeRate.ID.eq(Operation.EXCHANGE_RATE_ID))
.where(Operation.ACCOUNT_ID.eq(accountId))
.`as`("t_native")
)
.get().first().get("native_sum")
where data is KotlinReactiveEntityStore
FROM clause isn't generated and throws the following error:
Caused by: android.database.sqlite.SQLiteException: incomplete input (code 1): , while compiling: select sum(t_native._value) as native_sum from
at io.requery.android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
at io.requery.android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:937)
at io.requery.android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:540)
at io.requery.android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:598)
at io.requery.android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:60)
at io.requery.android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:41)
at io.requery.android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:44)
at io.requery.android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1456)
at io.requery.android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1398)
at io.requery.android.sqlitex.SqlitexStatement.executeQuery(SqlitexStatement.kt:55)
... 70 more
I am using dependencies with version 1.6.1
The text was updated successfully, but these errors were encountered:
Hi, @npurushe !
Thank you for this very nice library!
When I use a
io.requery:requery
dependency, the following query:where data is ReactiveEntityStore
Generates the following SQL:
But when I use
io.requery:requery-kotlin
dependency with minor changes (in the JOIN clause):where data is KotlinReactiveEntityStore
FROM clause isn't generated and throws the following error:
I am using dependencies with version 1.6.1
The text was updated successfully, but these errors were encountered: