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
Replaced AwesomeProject/index.js text with text from
AwesomeProject/node_modules/react-native-sqlite-storage/test/index.android.json1.js
npx react-native run-android
(Build successful and app appears on mobile device)
On mobile device
7) Press "Run Demo"
Result
Comments
I had to add step (4) myself to get the thing to work
In Step(5) the README.md tells you to replace index.ios.js, which does not exist
While I'm here, rather than instructing users to replace the file, it may be clearer to tell them to replace the code in the file. Also, the README section on 'Opening a database' might be more helpfully titled 'Creating a database', or 'Opening a new database'
Full Metro log
LOG Callback based runtime ready
LOG Running "AwesomeProject" with {"rootTag":1}
LOG OPEN database: Test.db
LOG SQLite.open({"name":"Test.db","dblocation":"nosync"})
LOG new transaction is waiting for open operation
LOG SQLite.backgroundExecuteSqlBatch({"dbargs":{"dbname":"Test.db"},"executes":[{"qid":1111,"sql":"SELECT 1","params":[]},{"qid":1111,"sql":"SELECT 1 FROM Version LIMIT 1","params":[]}]})
LOG received version error: {"code": 0, "message": "no such table: Version (code 1 SQLITE_ERROR[1]): , while compiling: SELECT 1 FROM Version LIMIT 1"}
LOG warning - exception while invoking a callback: {"code":0,"line":109240,"column":27,"sourceURL":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.awesomeproject&modulesOnly=false&runModule=true"}
LOG all config SQL done
LOG SQLite.backgroundExecuteSqlBatch({"dbargs":{"dbname":"Test.db"},"executes":[{"qid":1111,"sql":"BEGIN","params":[]},{"qid":1111,"sql":"DROP TABLE IF EXISTS Employees;","params":[]},{"qid":1111,"sql":"DROP TABLE IF EXISTS Offices;","params":[]},{"qid":1111,"sql":"DROP TABLE IF EXISTS Departments;","params":[]},{"qid":1111,"sql":"CREATE TABLE IF NOT EXISTS Version( version_id INTEGER PRIMARY KEY NOT NULL); ","params":[]},{"qid":1111,"sql":"CREATE TABLE IF NOT EXISTS Departments( department_id INTEGER PRIMARY KEY NOT NULL, name VARCHAR(30) ); ","params":[]},{"qid":1111,"sql":"CREATE TABLE IF NOT EXISTS Offices( office_id INTEGER PRIMARY KEY NOT NULL, name VARCHAR(20), longtitude FLOAT, latitude FLOAT ) ; ","params":[]},{"qid":1111,"sql":"CREATE TABLE IF NOT EXISTS Employees( employe_id INTEGER PRIMARY KEY NOT NULL, name VARCHAR(55), office INTEGER, department INTEGER, custom_info TEXT DEFAULT "",FOREIGN KEY ( office ) REFERENCES Offices ( office_id ) FOREIGN KEY ( department ) REFERENCES Departments ( department_id ));","params":[]},{"qid":1111,"sql":"INSERT INTO Departments (name) VALUES ("Client Services");","params":[]},{"qid":1111,"sql":"INSERT INTO Departments (name) VALUES ("Investor Services");","params":[]},{"qid":1111,"sql":"INSERT INTO Departments (name) VALUES ("Shipping");","params":[]},{"qid":1111,"sql":"INSERT INTO Departments (name) VALUES ("Direct Sales");","params":[]},{"qid":1111,"sql":"INSERT INTO Offices (name, longtitude, latitude) VALUES ("Denver", 59.8, 34.);","params":[]},{"qid":1111,"sql":"INSERT INTO Offices (name, longtitude, latitude) VALUES ("Warsaw", 15.7, 54.);","params":[]},{"qid":1111,"sql":"INSERT INTO Offices (name, longtitude, latitude) VALUES ("Berlin", 35.3, 12.);","params":[]},{"qid":1111,"sql":"INSERT INTO Offices (name, longtitude, latitude) VALUES ("Paris", 10.7, 14.);","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Sylvester Stallone", 2, 4, '{"known": true}')","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Elvis Presley", 2, 4, '{"known": true}')","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Leslie Nelson", 3, 4, '{"known": true}')","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Fidel Castro", 3, 3, '{"known": true}')","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Bill Clinton", 1, 3, '{"known": false}')","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Margaret Thatcher", 1, 3, '{"known": true}')","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Donald Trump", 2, 4, '{"known": true, "impeached": true}')","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Dr DRE", 2, 2, '{"known": true}')","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Samantha Fox", 2, 1, '{"known": true}')","params":[]}]})
LOG SQL executed ...
LOG SQL executed ...
LOG SQL executed ...
LOG SQLite.backgroundExecuteSqlBatch({"dbargs":{"dbname":"Test.db"},"executes":[{"qid":1111,"sql":"COMMIT","params":[]}]})
LOG Executing JSON1 queries...
LOG SQLite.backgroundExecuteSqlBatch({"dbargs":{"dbname":"Test.db"},"executes":[{"qid":1111,"sql":"BEGIN","params":[]},{"qid":1111,"sql":"SELECT JSON_OBJECT('name', e.name, 'office_id', e.office, 'department_id', e.department) AS data FROM Employees e","params":[]}]})
LOG error: {"code": 0, "message": "no such function: JSON_OBJECT (code 1 SQLITE_ERROR[1]): , while compiling: SELECT JSON_OBJECT('name', e.name, 'office_id', e.office, 'department_id', e.department) AS data FROM Employees e"}
LOG SQLite.backgroundExecuteSqlBatch({"dbargs":{"dbname":"Test.db"},"executes":[{"qid":1111,"sql":"ROLLBACK","params":[]}]})
LOG error: {"code": 0, "message": "no such function: JSON_OBJECT (code 1 SQLITE_ERROR[1]): , while compiling: SELECT JSON_OBJECT('name', e.name, 'office_id', e.office, 'department_id', e.department) AS data FROM Employees e"}
The text was updated successfully, but these errors were encountered:
Machine: Lenovo B50-10 (Intel Pentium CPU N3540 2.16GHz, 4GB RAM)
OS: Windows 10 Home build 19041.1083
Test device: Samsung Galaxy A70 SM-A705FN/DS running Android 11
Steps taken on laptop
AwesomeProject/node_modules/react-native-sqlite-storage/test/index.android.json1.js
(Build successful and app appears on mobile device)
On mobile device
7) Press "Run Demo"
Result
Comments
Full Metro log
LOG Callback based runtime ready
LOG Running "AwesomeProject" with {"rootTag":1}
LOG OPEN database: Test.db
LOG SQLite.open({"name":"Test.db","dblocation":"nosync"})
LOG new transaction is waiting for open operation
LOG SQLite.backgroundExecuteSqlBatch({"dbargs":{"dbname":"Test.db"},"executes":[{"qid":1111,"sql":"SELECT 1","params":[]},{"qid":1111,"sql":"SELECT 1 FROM Version LIMIT 1","params":[]}]})
LOG received version error: {"code": 0, "message": "no such table: Version (code 1 SQLITE_ERROR[1]): , while compiling: SELECT 1 FROM Version LIMIT 1"}
LOG warning - exception while invoking a callback: {"code":0,"line":109240,"column":27,"sourceURL":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.awesomeproject&modulesOnly=false&runModule=true"}
LOG all config SQL done
LOG SQLite.backgroundExecuteSqlBatch({"dbargs":{"dbname":"Test.db"},"executes":[{"qid":1111,"sql":"BEGIN","params":[]},{"qid":1111,"sql":"DROP TABLE IF EXISTS Employees;","params":[]},{"qid":1111,"sql":"DROP TABLE IF EXISTS Offices;","params":[]},{"qid":1111,"sql":"DROP TABLE IF EXISTS Departments;","params":[]},{"qid":1111,"sql":"CREATE TABLE IF NOT EXISTS Version( version_id INTEGER PRIMARY KEY NOT NULL); ","params":[]},{"qid":1111,"sql":"CREATE TABLE IF NOT EXISTS Departments( department_id INTEGER PRIMARY KEY NOT NULL, name VARCHAR(30) ); ","params":[]},{"qid":1111,"sql":"CREATE TABLE IF NOT EXISTS Offices( office_id INTEGER PRIMARY KEY NOT NULL, name VARCHAR(20), longtitude FLOAT, latitude FLOAT ) ; ","params":[]},{"qid":1111,"sql":"CREATE TABLE IF NOT EXISTS Employees( employe_id INTEGER PRIMARY KEY NOT NULL, name VARCHAR(55), office INTEGER, department INTEGER, custom_info TEXT DEFAULT "",FOREIGN KEY ( office ) REFERENCES Offices ( office_id ) FOREIGN KEY ( department ) REFERENCES Departments ( department_id ));","params":[]},{"qid":1111,"sql":"INSERT INTO Departments (name) VALUES ("Client Services");","params":[]},{"qid":1111,"sql":"INSERT INTO Departments (name) VALUES ("Investor Services");","params":[]},{"qid":1111,"sql":"INSERT INTO Departments (name) VALUES ("Shipping");","params":[]},{"qid":1111,"sql":"INSERT INTO Departments (name) VALUES ("Direct Sales");","params":[]},{"qid":1111,"sql":"INSERT INTO Offices (name, longtitude, latitude) VALUES ("Denver", 59.8, 34.);","params":[]},{"qid":1111,"sql":"INSERT INTO Offices (name, longtitude, latitude) VALUES ("Warsaw", 15.7, 54.);","params":[]},{"qid":1111,"sql":"INSERT INTO Offices (name, longtitude, latitude) VALUES ("Berlin", 35.3, 12.);","params":[]},{"qid":1111,"sql":"INSERT INTO Offices (name, longtitude, latitude) VALUES ("Paris", 10.7, 14.);","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Sylvester Stallone", 2, 4, '{"known": true}')","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Elvis Presley", 2, 4, '{"known": true}')","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Leslie Nelson", 3, 4, '{"known": true}')","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Fidel Castro", 3, 3, '{"known": true}')","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Bill Clinton", 1, 3, '{"known": false}')","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Margaret Thatcher", 1, 3, '{"known": true}')","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Donald Trump", 2, 4, '{"known": true, "impeached": true}')","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Dr DRE", 2, 2, '{"known": true}')","params":[]},{"qid":1111,"sql":"INSERT INTO Employees (name, office, department, custom_info) VALUES ("Samantha Fox", 2, 1, '{"known": true}')","params":[]}]})
LOG SQL executed ...
LOG SQL executed ...
LOG SQL executed ...
LOG SQLite.backgroundExecuteSqlBatch({"dbargs":{"dbname":"Test.db"},"executes":[{"qid":1111,"sql":"COMMIT","params":[]}]})
LOG Executing JSON1 queries...
LOG SQLite.backgroundExecuteSqlBatch({"dbargs":{"dbname":"Test.db"},"executes":[{"qid":1111,"sql":"BEGIN","params":[]},{"qid":1111,"sql":"SELECT JSON_OBJECT('name', e.name, 'office_id', e.office, 'department_id', e.department) AS data FROM Employees e","params":[]}]})
LOG error: {"code": 0, "message": "no such function: JSON_OBJECT (code 1 SQLITE_ERROR[1]): , while compiling: SELECT JSON_OBJECT('name', e.name, 'office_id', e.office, 'department_id', e.department) AS data FROM Employees e"}
LOG SQLite.backgroundExecuteSqlBatch({"dbargs":{"dbname":"Test.db"},"executes":[{"qid":1111,"sql":"ROLLBACK","params":[]}]})
LOG error: {"code": 0, "message": "no such function: JSON_OBJECT (code 1 SQLITE_ERROR[1]): , while compiling: SELECT JSON_OBJECT('name', e.name, 'office_id', e.office, 'department_id', e.department) AS data FROM Employees e"}
The text was updated successfully, but these errors were encountered: