diff --git a/packages/server/src/integrations/mysql.ts b/packages/server/src/integrations/mysql.ts index c3bb5e066f..46bd97836b 100644 --- a/packages/server/src/integrations/mysql.ts +++ b/packages/server/src/integrations/mysql.ts @@ -39,6 +39,7 @@ const SCHEMA: Integration = { features: { [DatasourceFeature.CONNECTION_CHECKING]: true, [DatasourceFeature.FETCH_TABLE_NAMES]: true, + [DatasourceFeature.EXPORT_SCHEMA]: true, }, datasource: { host: { @@ -324,6 +325,14 @@ class MySQLIntegration extends Sql implements DatasourcePlus { 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 {