Lines Matching refs:stmt
345 const affirmColIndex = function(stmt,ndx){ argument
346 if((ndx !== (ndx|0)) || ndx<0 || ndx>=stmt.columnCount){
349 return stmt;
412 case 'object': out.cbArg = (stmt)=>stmt.get(Object.create(null)); break; argument
413 case 'array': out.cbArg = (stmt)=>stmt.get([]); break;
420 out.cbArg = (stmt)=>stmt; argument
424 out.cbArg = (stmt)=>stmt.get(opt.rowMode);
430 out.cbArg = function(stmt){
431 const rc = stmt.get(this.obj)[this.colName];
451 let stmt, rc;
453 stmt = db.prepare(sql).bind(bind);
454 if(stmt.step()) rc = stmt.get(getArg);
456 if(stmt) stmt.finalize();
617 const stmt = new Stmt(this, pStmt, BindTypes);
618 __stmtMap.get(this)[pStmt] = stmt;
619 return stmt;
771 let stmt;
812 stmt = new Stmt(this, pStmt, BindTypes);
813 if(bind && stmt.parameterCount){
814 stmt.bind(bind);
817 if(evalFirstResult && stmt.columnCount){
822 stmt.getColumnNames(opt.columnNames);
824 while(!!arg.cbArg && stmt.step()){
825 stmt._isLocked = true;
826 const row = arg.cbArg(stmt);
828 if(callback) callback.call(opt, row, stmt);
829 stmt._isLocked = false;
832 stmt.step();
834 stmt.finalize();
835 stmt = null;
841 if(stmt){
842 delete stmt._isLocked;
843 stmt.finalize();
1042 let stmt, rc;
1044 stmt = this.prepare(sql).bind(bind);
1045 if(stmt.step()) rc = stmt.get(0,asType);
1047 if(stmt) stmt.finalize();
1139 const affirmStmtOpen = function(stmt){ argument
1140 if(!stmt.pointer) toss3("Stmt has been closed.");
1141 return stmt;
1183 const affirmParamIndex = function(stmt,key){ argument
1185 ? key : capi.sqlite3_bind_parameter_index(stmt.pointer, key);
1189 else if(n<1 || n>stmt.parameterCount) toss3("Bind index",key,"is out of range.");
1201 const affirmUnlocked = function(stmt,currentOpName){ argument
1202 if(stmt._isLocked){
1205 return stmt;
1214 const bindOne = function f(stmt,ndx,bindType,val){ argument
1215 affirmUnlocked(stmt, 'bind()');
1224 string: function(stmt, ndx, val, asBlob){ argument
1233 return f(stmt.pointer, ndx, pStr, n, capi.SQLITE_TRANSIENT);
1243 return f(stmt.pointer, ndx, pStr, bytes.length, capi.SQLITE_TRANSIENT);
1252 ndx = affirmParamIndex(stmt,ndx);
1256 rc = capi.sqlite3_bind_null(stmt.pointer, ndx);
1259 rc = f._.string(stmt, ndx, val, false);
1283 rc = m(stmt.pointer, ndx, val);
1287 rc = capi.sqlite3_bind_int(stmt.pointer, ndx, val ? 1 : 0);
1291 rc = f._.string(stmt, ndx, val, true);
1301 rc = capi.sqlite3_bind_blob(stmt.pointer, ndx, pBlob, val.byteLength,
1309 rc = capi.sqlite3_bind_blob(stmt.pointer, ndx, pBlob, val.byteLength,
1321 if(rc) DB.checkRc(stmt.db.pointer, rc);
1322 return stmt;