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
My app works perfectly on iOS, and I'm trying to port it to Android. Any time I run a query with the Returning keyword I get the error below:
unknown error (code 0 SQLITE_OK): Queries can be performed using SQLiteDatabase query or rawQuery methods only.
I tried adding a react-native.config.js file as per the instructions, but I get the same error. I really don't want to have different code for Android and iOS. How do I get these queries to work? Is there a "raw query" mode?
Expected Behavior
db.executeSql("INSERT INTO MyTable VALUES (...) RETURNING rowid");
Should add a new row to the table and return the rowid, exactly as it does on iOS.
Current Behavior
Get error above, no rowid.
Possible Solution
Make it work the same as iOS?
Or if that's not possible, make a executeRawSql() interface?
Steps to Reproduce (for bugs)
As above, create a table, and try to insert a row and return the rowid. On Android it returns an error. On iOS it works.
Context
Seems like iOS and Android interfaces differ.
Your Environment
React Native SQLite Storage Version used: 6.0.1
React Native version used: 0.72.6
Operating System and version (simulator or device): Android Studio Pixel 3A emulator, Android 34 (upside down cake)
IDE used: Android Studio / command line React Native Tools
Link to your project:
Debug logs
The text was updated successfully, but these errors were encountered:
My app works perfectly on iOS, and I'm trying to port it to Android. Any time I run a query with the Returning keyword I get the error below:
I tried adding a react-native.config.js file as per the instructions, but I get the same error. I really don't want to have different code for Android and iOS. How do I get these queries to work? Is there a "raw query" mode?
Expected Behavior
db.executeSql("INSERT INTO MyTable VALUES (...) RETURNING rowid");
Should add a new row to the table and return the rowid, exactly as it does on iOS.
Current Behavior
Get error above, no rowid.
Possible Solution
Make it work the same as iOS?
Or if that's not possible, make a executeRawSql() interface?
Steps to Reproduce (for bugs)
As above, create a table, and try to insert a row and return the rowid. On Android it returns an error. On iOS it works.
Context
Seems like iOS and Android interfaces differ.
Your Environment
Debug logs
The text was updated successfully, but these errors were encountered: