-
Notifications
You must be signed in to change notification settings - Fork 311
Description
Hi,
Electric (react-native ?) client's code makes use of the "RETURNING" clause in the SQLite queries.
This "clause" is supported in SQLite 3.35.0 and above (https://www.sqlite.org/lang_returning.html) the issue is that these versions of SQLite are not supported before API 34 of Android (https://developer.android.com/reference/android/database/sqlite/package-summary) which means less that 5% of the Android market share (https://gs.statcounter.com/os-version-market-share/android).
Issue Reproduction
As an example, testing the provided react-native application with a Pixel 5 (API 33) fails at startup with a
Object {
"code": 0,
"message": "near \"RETURNING\": syntax error (code 1 SQLITE_ERROR): , while compiling: UPDATE main._electric_oplog SET timestamp = ?
WHERE rowid in (
SELECT rowid FROM main._electric_oplog
WHERE timestamp is NULL
ORDER BY rowid ASC
)
RETURNING *",
}
this issue is not encountered when :
- running this query without the
RETURNINGclause - running on a Pixel 6 (API 34).
Possible fixes
I guess there are 2 ways of fixing this problem :
- remove the
RETURNINGclauses - use a SQLite "driver" lib that ships with its own SQLite (in a supported version), like
Do I miss something or are there something planned about this ? (I'd happily make a new adapter for react-native-quick-sqlite)
Best,
Matthieu