当我尝试比较这两种架构时,为什么会变得不确定?

问题描述

我正在使用dbdiff npm软件包来比较两个数据库的架构。当我插入两个模式时,将得到未定义的输出。 diff.compareSchemas()也不会让我使用.then语句,可能是因为输出未定义。我不确定我需要做什么才能使输出成为未定义的内容

const dbdiff = require('dbdiff'),diff = new dbdiff.DbDiff(),schema = [];

(async () => {
    await dbdiff.describedatabase({
       dialect: 'MysqL',username: 'root',password: 'redacted',database: 'redacted',host: 'localhost',dialectOptions: {
          ssl: false
       }
    }).then((res) => {
       schema[0] = res;
    });
   
    await dbdiff.describedatabase({
       dialect: 'MysqL',dialectOptions: {
          ssl: false
       }
    }).then((res) => {
       schema[1] = res;
    });
    
    const schemaDiff = await diff.compareSchemas(schema[0],schema[1])
    console.log(diff.commands('drop'));
    console.log(schemaDiff);
})();

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)