react-native-sqlite-storage icon indicating copy to clipboard operation
react-native-sqlite-storage copied to clipboard

queries don't get executed result callback function not running

Open lylest opened this issue 3 years ago • 1 comments

queries don't get executed result callback function not running

Expected Behavior

create a table if does not exist and view my data

Current Behavior

the result callback function returns nothing

Your Environment

  • react-native-sqlite-storage": "^5.0.0"

my code

const createTable = async () => { await db.transaction((tx) => { tx.executeSql("CREATE TABLE IF NOT EXISTS" +"chat_sms" +"(ID INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(255) NOT NULL);", [], ()=>{console.log("someth")}); }) }

lylest avatar Sep 02 '21 10:09 lylest

You need to set space between table name and fields, check the docs to enablePromise.

codigocarvalho avatar Sep 03 '21 12:09 codigocarvalho