(
result: DatabaseResultSet,
schemaName: string
)
| 97 | } |
| 98 | |
| 99 | protected getSchemaList( |
| 100 | result: DatabaseResultSet, |
| 101 | schemaName: string |
| 102 | ): DatabaseSchemaItem[] { |
| 103 | const tmp: DatabaseSchemaItem[] = []; |
| 104 | const rows = result.rows as Array<{ |
| 105 | type: string; |
| 106 | name: string; |
| 107 | tbl_name: string; |
| 108 | sql: string; |
| 109 | }>; |
| 110 | |
| 111 | for (const row of rows) { |
| 112 | if (row.type === "table") { |
| 113 | try { |
| 114 | tmp.push({ |
| 115 | type: "table", |
| 116 | schemaName, |
| 117 | name: row.name, |
| 118 | tableSchema: parseCreateTableScript(schemaName, row.sql), |
| 119 | }); |
| 120 | } catch { |
| 121 | tmp.push({ type: "table", name: row.name, schemaName }); |
| 122 | } |
| 123 | } else if (row.type === "trigger") { |
| 124 | tmp.push({ |
| 125 | type: "trigger", |
| 126 | name: row.name, |
| 127 | tableName: row.tbl_name, |
| 128 | schemaName, |
| 129 | }); |
| 130 | } else if (row.type === "view") { |
| 131 | tmp.push({ type: "view", name: row.name, schemaName }); |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | return tmp; |
| 136 | } |
| 137 | |
| 138 | protected async legacyTableSchema( |
| 139 | schemaName: string, |
no test coverage detected