import Expo, { SQLite } from 'expo';
const db = SQLite.openDatabase('db.db');
export function create(){
db.transaction(tx => {
tx.executeSql(
'CREATE TABLE if not exists material_mg (ID INT PRIMARY KEY ,order_number VARCHAR(10) ,truck_number VARCHAR(10) ,enter_mine_date TEXT ,vehicle_owner_name VARCHAR(50) ,driver_address TEXT ,driver_mobile_number BIGINT ,weigh_bridge FLOAT,in_time TEXT ,out_time TEXT ,drop_off_point TEXT ,transporter_name VARCHAR(50) ,loaded_from VARCHAR(50) ,mines_name VARCHAR(50) ,material VARCHAR(20) ,total_number_of_seats SMALLINT ,loading_in_timestamp TEXT,loading_out_timestamp TEXT,unloading_company_name VARCHAR(50) ,unloading_company_address VARCHAR(100),type_of_trip VARCHAR(5) ,loading_supervisor_name VARCHAR(50) ,weight FLOAT ,challan_date TEXT,challan_number VARCHAR(10) ,t_h CHAR ,party_name VARCHAR(50) ,sil_number VARCHAR(10) ,diesel INT,advance INT,booking_name VARCHAR(50) ,colliery_name VARCHAR(50) ,lifter_name VARCHAR(50) ,coalnet_weight FLOAT ,gross_weight FLOAT ,tare_weight FLOAT ,net_weight FLOAT ,remarks TEXT ,ccl_bill_number INT ,cash INT ,destination VARCHAR(50) ,broker_name VARCHAR(50) ,broker_mobile_number BIGINT )',null,(tx,resultset)=>{console.log(resultset)},(tx,resultset)=>{console.log(resultset)}
);
});
}
The above code is my database file. when i execute this create query i get attempt to write a readonly database (code 1032)
error. I am using the expo client with React Native. Not sure about where to configure the access control. Can't find anything on the expo sqlite docs as well. Any help is appreciated. The other solutions mentioned don't apply here because i am using the CRNA approach.