比如我用egg-mysql框架提供的
const results = await this.app.mysql.select('posts', { // 搜索 post 表
where: { status: 'draft', author: ['author1', 'author2'] }, // WHERE 条件
columns: ['author', 'title'], // 要查询的表字段
orders: [['created_at','desc'], ['id','desc']], // 排序方式
limit: 10, // 返回数据量
offset: 0, // 数据偏移量
});
我该如何查看这条封装语句所执行的原生sql语句呢??
看了文档,没有发现有这个功能。可否换个做法去处理,使用mysql log来调试。
不使用的时候记得关掉,否则会大量占用磁盘空间。