1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Consolidate oo1.DB.exec() and oo1.DB.execMulti() into oo1.DB.exec(). This is a bit less efficient but certainly easier for a client to deal with and lightens the maintenance burden.

FossilOrigin-Name: 7eff7213dff553b76d7ce45063e3c4a19544716611a0b609593d704076b38d0b
This commit is contained in:
stephan
2022-08-25 13:27:52 +00:00
parent 9afff9f3c5
commit 335ad5264f
6 changed files with 117 additions and 185 deletions

View File

@ -70,7 +70,7 @@
(ev.workerRespondTime - ev.workerReceivedTime),"ms.",
"Round-trip event time =",
(performance.now() - ev.departureTime),"ms.",
(evd.errorClass ? ev.message : ""), evd
(evd.errorClass ? ev.message : "")//, JSON.stringify(evd)
);
};
@ -149,10 +149,9 @@
throw new Error("This is not supposed to be reached.");
};
runOneTest('exec',{
sql: ["create table t(a,b)",
sql: ["create table t(a,b);",
"insert into t(a,b) values(1,2),(3,4),(5,6)"
].join(';'),
multi: true,
],
resultRows: [], columnNames: []
}, function(ev){
ev = ev.result;
@ -161,7 +160,7 @@
});
runOneTest('exec',{
sql: 'select a a, b b from t order by a',
resultRows: [], columnNames: [],
resultRows: [], columnNames: [], saveSql:[]
}, function(ev){
ev = ev.result;
T.assert(3===ev.resultRows.length)
@ -170,6 +169,7 @@
.assert(2===ev.columnNames.length)
.assert('b'===ev.columnNames[1]);
});
//if(1){ error("Returning prematurely for testing."); return; }
runOneTest('exec',{
sql: 'select a a, b b from t order by a',
resultRows: [], columnNames: [],
@ -200,12 +200,12 @@
dbMsgHandler.resultRowTest1.counter = 0;
});
runOneTest('exec',{
multi: true,
sql:[
'pragma foreign_keys=0;',
"pragma foreign_keys=0;",
// ^^^ arbitrary query with no result columns
'select a, b from t order by a desc; select a from t;'
// multi-exec only honors results from the first
"select a, b from t order by a desc;",
"select a from t;"
// multi-statement exec only honors results from the first
// statement with result columns (regardless of whether)
// it has any rows).
],