Skip to content

Commit 3345655

Browse files
committed
Simplify the documentation and remove console.log from tests
1 parent a73bc40 commit 3345655

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/api.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1017,9 +1017,8 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
10171017
* @example <caption>Get the results of multiple SQL queries</caption>
10181018
* const sql_queries = "SELECT 1 AS x; SELECT '2' as y";
10191019
* for (const statement of db.iterateStatements(sql_queries)) {
1020-
* statement.step(); // Execute the statement
10211020
* const sql = statement.getSQL(); // Get the SQL source
1022-
* const result = statement.getAsObject(); // Get the row of data
1021+
* const result = statement.getAsObject({}); // Get the row of data
10231022
* console.log(sql, result);
10241023
* }
10251024
* // This will print:

test/test_statement_iterator.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,10 @@ exports.test = function (SQL, assert) {
7878
const results = [];
7979
const sql_queries = "SELECT 1 AS x; SELECT '2' as y";
8080
for (const statement of db.iterateStatements(sql_queries)) {
81-
statement.step(); // Fetch one line of result from the statement
8281
const sql = statement.getSQL();
83-
const result = statement.getAsObject();
82+
const result = statement.getAsObject({});
8483
results.push({ sql, result });
8584
}
86-
console.log(results);
8785
assert.deepEqual(results, [
8886
{ sql: 'SELECT 1 AS x;', result: { x: 1 } },
8987
{ sql: " SELECT '2' as y", result: { y: '2' } }

0 commit comments

Comments
 (0)