Get mysql schema

This commit is contained in:
Adria Navarro 2023-06-19 14:57:39 +01:00
parent 76ac28f550
commit ab5b8716c0
1 changed files with 9 additions and 0 deletions

View File

@ -39,6 +39,7 @@ const SCHEMA: Integration = {
features: { features: {
[DatasourceFeature.CONNECTION_CHECKING]: true, [DatasourceFeature.CONNECTION_CHECKING]: true,
[DatasourceFeature.FETCH_TABLE_NAMES]: true, [DatasourceFeature.FETCH_TABLE_NAMES]: true,
[DatasourceFeature.EXPORT_SCHEMA]: true,
}, },
datasource: { datasource: {
host: { host: {
@ -324,6 +325,14 @@ class MySQLIntegration extends Sql implements DatasourcePlus {
await this.disconnect() await this.disconnect()
} }
} }
async getExternalSchema() {
const [result] = await this.internalQuery({
sql: `SHOW CREATE DATABASE ${this.config.database}`,
})
const schema = result["Create Database"]
return schema
}
} }
export default { export default {