| 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'${ |
| 30 | schema == null ? "" : " AND schema = ?" |
| 31 | } AND name NOT LIKE 'sqlite_%' ORDER BY schema, name`, |
| 32 | schema == null ? [] : [schema] |
| 33 | ); |
| 34 | } |
| 35 | async describeColumns({schema, table} = {}) { |
| 36 | if (table == null) throw new Error("missing table"); |
| 37 | const rows = await this.query( |