Typeorm raw sql

This article is tagged with: Typeorm raw sql and mysql

typeorm raw sql

const rawData = await manager.query(`SELECT * FROM USERS`);

typeorm raw query

import { getManager } from 'typeorm';
const entityManager = getManager();
const someQuery = entityManager.query(`
SELECT
fw."X",
fw."Y",
ew.*
FROM "table1" as fw
JOIN "table2" as ew
ON fw."X" = $1 AND ew.id = fw."Y";
`, [param1]);

This article is tagged with: Typeorm raw sql and mysql