You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this is fine, as one can define the interface separately e.g.
// This works
prisma.$queryRaw<{ id: number }[]>`
SELECT id from machine
`
// This also works
interface Demo {
id: number
}
prisma.$queryRaw<Demo[]>`
SELECT id from machine
`
// This does not work, because the return type declaration spans multiple lines
prisma.$queryRaw<{
id: number
}[]>`
SELECT id from machine
`
now adding safeql to the equation, breaks, when working with enums for some reason
...
interface Demo {
task_definition_class_type:
| 'BASIC'
| 'WORK_PACKAGE'
| 'WORK_ITEM'
| 'ADDITIONAL'
| 'ROADBLOCK'
| 'TASK'
| 'QUALITY'
| 'LEGACY_PREREQUISITE'
| null;
}
return client.$queryRaw<Demo[]>`
SELECT
td.class_type as task_definition_class_type
FROM table1 ti
LEFT JOIN table2 td ON ti.task_definition_id = td.id;
`
The lack of syntax highlighting after multi-line generic arguments is a problem with VS Code and TextMate grammars not being able to span across multiple lines:
However, a workaround exists for many syntax highlighting extensions (such as SQL tagged template literals by @frigus02), to use a comment (such as /* sql */) between the generic arguments list and the template string (after the > and before the `):
Describe the bug
now adding safeql to the equation, breaks, when working with enums for some reason
results in safeql error:
tried to change the order of the union keys -> didn't work either. only fix is to add a //prettier-ignore for the line, so somewhat inconvenient
this works, but again, breaks prisma syntax highlighting
The text was updated successfully, but these errors were encountered: