MCPcopy Create free account
hub / github.com/GoogleChrome/samples / __selectFirstRow

Function __selectFirstRow

sqlite-wasm-cos/sqlite3.mjs:13383–13392  ·  view source on GitHub ↗
(db, sql, bind, ...getArgs)

Source from the content-addressed store, hash-verified

13381 selectObject() methods.
13382 */
13383 const __selectFirstRow = (db, sql, bind, ...getArgs)=>{
13384 const stmt = db.prepare(sql);
13385 try {
13386 const rc = stmt.bind(bind).step() ? stmt.get(...getArgs) : undefined;
13387 stmt.reset(/*for INSERT...RETURNING locking case*/);
13388 return rc;
13389 }finally{
13390 stmt.finalize();
13391 }
13392 };
13393
13394 /**
13395 Internal impl of the DB.selectArrays() and selectObjects()

Callers 1

sqlite3InitModuleFunction · 0.70

Calls 3

finalizeMethod · 0.80
getMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected