MCPcopy Create free account
hub / github.com/observablehq/framework / exec

Function exec

src/client/stdlib/sqlite.js:133–140  ·  view source on GitHub ↗
(db, query, params)

Source from the content-addressed store, hash-verified

131}
132
133async function exec(db, query, params) {
134 const [result] = await db.exec(query, params);
135 if (!result) return [];
136 const {columns, values} = result;
137 const rows = values.map((row) => Object.fromEntries(row.map((value, i) => [columns[i], value])));
138 rows.columns = columns;
139 return rows;
140}
141
142function element(name, props, children) {
143 if (arguments.length === 2) (children = props), (props = undefined);

Callers 2

getProjectIdMethod · 0.85
queryMethod · 0.85

Calls 1

execMethod · 0.45

Tested by

no test coverage detected