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

Function __selectFirstRow

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

Source from the content-addressed store, hash-verified

13260 selectObject() methods.
13261 */
13262 const __selectFirstRow = (db, sql, bind, ...getArgs)=>{
13263 const stmt = db.prepare(sql);
13264 try {
13265 const rc = stmt.bind(bind).step() ? stmt.get(...getArgs) : undefined;
13266 stmt.reset(/*for INSERT...RETURNING locking case*/);
13267 return rc;
13268 }finally{
13269 stmt.finalize();
13270 }
13271 };
13272
13273 /**
13274 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