I have the same query that I've specified in an SQL file, and code gen properly processes it. But, when I move that query to a .ts file, so that I can actually use it in TS program, it fails with the same error that it gives for all failures.
The query in the SQL file that that works is:
-- query_name = allRunners
SELECT runners.id,
runners.firstName,
runners.lastName,
runners.sex,
runners.grade,
runners.schoolId,
runners.raceId,
meets.id as meetsId
FROM runners as runners
LEFT JOIN races as races ON races.id = runners.raceId
LEFT JOIN meets as meets ON meetsId = races.meetId
ORDER BY meetsId,
races.id,
runners.schoolId,
runners.id
The query in the TS file that fails to be parsed is:
export const sql = `
-- query_name = allRunners
SELECT runners.id,
runners.firstName,
runners.lastName,
runners.sex,
runners. Grade,
runners.schoolId,
runners.raceId,
meets.id as meetsId
FROM runners as runners
LEFT JOIN races as races ON races.id = runners.raceId
LEFT JOIN meets as meets ON meetsId = races.meetId
ORDER BY meetsId,
races.id,
runners.schoolId,
runners.id
`;
The error given is simply:
Error: could not extract sql from file at path '...queries/allrunners.ts'
I have the same query that I've specified in an SQL file, and code gen properly processes it. But, when I move that query to a .ts file, so that I can actually use it in TS program, it fails with the same error that it gives for all failures.
The query in the SQL file that that works is:
The query in the TS file that fails to be parsed is:
The error given is simply: