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
Hi, so I have a question I need to find a solution to.
we are using this client side and server side for now as its quick on most things. we have recently come into an issue with bulk inserting.
so ill give an example.
We have a table
they have key features that need to happen. the server needs to know if it has to insert it or update it. So we can get around that by the client sending up all the UPDATES at once and all the INSERTS at once.. this is where our problem comes
the sync ID stops duplications so the server needs to check if it exists before allowing it to insert.
`try {
//connect to DB
try {
var ProdDb = new Sqlite(path.join(db_path, 'DB/' + data_decrypt.DBname + '.db3'));
} catch (e) {
console.log(e);
}
//create if doesnt exist
var stmnt = ProdDb.prepare("CREATE TABLE IF NOT EXISTS Log (ID INTEGER PRIMARY KEY NOT NULL, TimeStamp varchar(254), Error varchar(254), SyncID varchar(254), DateChanged varchar(254), PageChanged varchar(254), SearchID varchar(254), Item varchar(254), Username varchar(254), Description varchar(254), EpsNum varchar(254))");
stmnt.run();
Although I've helped answer questions like this in the past, as this package is getting more popular I'm going to relinquish my responsibility of helping people learn how to write proper SQLite and Node.js.
I haven't taken a deep look at your code but it appear to be fine at face-value. The de-facto answer to almost all performance questions in SQLite is to activate WAL mode:
Hi, so I have a question I need to find a solution to.
we are using this client side and server side for now as its quick on most things. we have recently come into an issue with bulk inserting.
so ill give an example.
We have a table
they have key features that need to happen. the server needs to know if it has to insert it or update it. So we can get around that by the client sending up all the UPDATES at once and all the INSERTS at once.. this is where our problem comes
the sync ID stops duplications so the server needs to check if it exists before allowing it to insert.
`try {
//connect to DB
try {
var ProdDb = new Sqlite(path.join(db_path, 'DB/' + data_decrypt.DBname + '.db3'));
} catch (e) {
console.log(e);
}
//create if doesnt exist
var stmnt = ProdDb.prepare("CREATE TABLE IF NOT EXISTS Log (ID INTEGER PRIMARY KEY NOT NULL, TimeStamp varchar(254), Error varchar(254), SyncID varchar(254), DateChanged varchar(254), PageChanged varchar(254), SearchID varchar(254), Item varchar(254), Username varchar(254), Description varchar(254), EpsNum varchar(254))");
stmnt.run();
so obviously its alot of data to handle we have 47K rows and the server just isnt dealing with it quick enough.
The text was updated successfully, but these errors were encountered: