(query, params)
| 21 | return (await this.query(query, params))[0] || null; |
| 22 | } |
| 23 | async explain(query, params) { |
| 24 | const rows = await this.query(`EXPLAIN QUERY PLAN ${query}`, params); |
| 25 | return element("pre", {className: "observablehq--inspect"}, [text(rows.map((row) => row.detail).join("\n"))]); |
| 26 | } |
| 27 | async describeTables({schema} = {}) { |
| 28 | return this.query( |
| 29 | `SELECT NULLIF(schema, 'main') AS schema, name FROM pragma_table_list() WHERE type = 'table'${ |