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

Method query

src/client/stdlib/duckdb.js:113–127  ·  view source on GitHub ↗
(query, params)

Source from the content-addressed store, hash-verified

111 }
112
113 async query(query, params) {
114 const connection = await this._db.connect();
115 let table;
116 try {
117 if (params?.length > 0) {
118 const statement = await connection.prepare(query);
119 table = await statement.query(...params);
120 } else {
121 table = await connection.query(query);
122 }
123 } finally {
124 await connection.close();
125 }
126 return table;
127 }
128
129 async queryRow(query, params) {
130 const result = await this.queryStream(query, params);

Callers 8

sqlMethod · 0.95
describeTablesMethod · 0.95
describeColumnsMethod · 0.95
sqlFunction · 0.45
registerExtensionsFunction · 0.45
insertUrlFunction · 0.45
insertFileFunction · 0.45
runQueryFunction · 0.45

Calls 2

prepareMethod · 0.65
closeMethod · 0.45

Tested by

no test coverage detected