如何解决当我尝试比较这两种架构时,为什么会变得不确定?
我正在使用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 举报,一经查实,本站将立刻删除。