({schema, table} = {})
| 33 | ); |
| 34 | } |
| 35 | async describeColumns({schema, table} = {}) { |
| 36 | if (table == null) throw new Error("missing table"); |
| 37 | const rows = await this.query( |
| 38 | `SELECT name, type, "notnull" FROM pragma_table_info(?${schema == null ? "" : ", ?"}) ORDER BY cid`, |
| 39 | schema == null ? [table] : [table, schema] |
| 40 | ); |
| 41 | if (!rows.length) throw new Error(`table not found: ${table}`); |
| 42 | return rows.map(({name, type, notnull}) => ({ |
| 43 | name, |
| 44 | type: sqliteType(type), |
| 45 | databaseType: type, |
| 46 | nullable: !notnull |
| 47 | })); |
| 48 | } |
| 49 | async describe(object) { |
| 50 | const rows = await (object === undefined |
| 51 | ? this.query("SELECT name FROM sqlite_master WHERE type = 'table'") |
nothing calls this directly
no test coverage detected