我有一个复杂的MySQL Select查询,尝试使用manager.query()
执行查询。
尽管有数据,但我没有得到结果。
下面是我要通过typeorm manager.query执行的查询。
SELECT v.id AS id, t.published AS publisedDate,t.updated AS lastModifiedDate, d.description AS summary FROM ab v INNER JOIN bc d ON v.id = d.id INNER JOIN time_latency t ON t.id = v.id WHERE DATE(v.sys_created) < '2007-04-02' AND v.source_id = '54'"
根据运行情况,我收到100000
条目,但无法期望上述查询的结果。
test("test1", async () => {
jest.setTimeout(10000000);
const connection = await createConnection();
const query1 = await connection.manager.query("SELECT v.id AS id, t.published AS publisedDate,t.updated AS lastModifiedDate, d.description AS summary FROM ab v INNER JOIN bc d ON v.id = d.id INNER JOIN time_latency t ON t.id = v.id WHERE DATE(v.sys_created) < '2007-04-02' AND v.source_id = '54'");
console.log(query1 );
await connection.close();
});