File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff 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:
Original file line number Diff line number Diff 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' } }
You can’t perform that action at this time.
0 commit comments