How to bind `null` argument to query with SQLCipher Android refresh?

In android-database-sqlcipher you can bind null to raw queries, but in sqlcipher-android this seems to be disallowed. This is causing an issue for us because our program logic generates queries with a literal null passed as one of the bind arguments.

This was working before with android-database-sqlcipher, but it concerns me that it doesn’t look like null arguments can be bound to queries anymore with sqlcipher-android. Is there a new way of constructing a query with a null bind arg?

We are using the SQLiteDatabase.rawQuery(sql, args) API on Android.

ETA: Even more concerning is that the same generated query works fine with SQLCipher on iOS using SQLiteStatement.bind(...). We are worried that platform disparity indicates this may be a bug?

Hi @Nikolai_Kotula,

Thank you for reaching out. The prevention of null binding originated in the Android Binding project, the origin of the newer sqlcipher-android project. We agree that supporting null parameter binding via the rawQuery API should be supported. I have included a change in the master branch which will be included in our next upcoming SQLCipher release.

1 Like

Thank you for tho followup! I’m glad it was as simple as that :grin: