Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

SQLite React-Native (react-native-sqlite-storage): no such table

$
0
0

I followed the react-native-sqlite-storage instructions on setting up the database but I'm encountering an error where it says there is SQL ERROR: {"no such table: users", code 5}

I've tried multiple styles where I have it in the "www" folder but to no avail.

import SQLite from 'react-native-sqlite-storage';...const database_name = "./users.db";const database_version = "1.0";const database_displayname = "Test";const database_size = 200000;...function loadAndQueryDB() {   //db = SQLite.openDatabase(database_name, database_version, database_displayname,      database_size, openCB, errorCB);   //db = SQLite.openDatabase({ name: './users.db', createFromLocation: 1,}, openCB, errorCB);   //db = SQLite.openDatabase({ name: 'users.db', createFromLocation: 1,}, openCB, errorCB);   //db = SQLite.openDatabase({ name: 'users', createFromLocation: 1,}, openCB, errorCB);    queryUsers(db);}function queryUsers(db) {    db.transaction((tx) => {      tx.executeSql('SELECT * FROM users', [], queryUsersSuccess, errorCB);    });  }

Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>