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
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
How do I specify the types for a raw sql statement? I have the following code, but I have to override the types to unknown before I can get the types out.
interfaceSQLResults{numResponses: number;opsTeam: number;}constcsFeedbackMTD=sql<SQLResults>` SELECT a.ops_team AS opsTeam, COUNT(DISTINCT(a.customer_fk)) AS numResponses FROM ( SELECT ${eventsTable.customer}, ${eventsTable.opsTeam} FROM ${eventsTable} WHERE${eventsTable.type} IN(8, 14) AND${eventsTable.effectiveDate} BETWEEN ${format(startDate,"yyyy-MM-dd")} AND ${format(endDate,"yyyy-MM-dd")} UNION ALL SELECT ${eventsTable.customer}, ${eventsTable.opsTeam} FROM ${eventsTable} WHERE${eventsTable.type} = 6 AND${eventsTable.scoredByEntity} = 1 AND${eventsTable.effectiveDate} BETWEEN ${format(startDate,"yyyy-MM-dd")} AND ${format(endDate,"yyyy-MM-dd")} ) a LEFT OUTER JOIN ${customersTable} ON a.customer_fk = ${customersTable.id} WHERE${customersTable.startDate} < DATE_SUB(CURDATE(),INTERVAL 10 DAY) AND a.ops_team IS NOT NULL GROUP BY a.ops_team`;// This type override is wrong, this is because the database.execute type is wrongconst[result]=(awaitdatabase.execute(csFeedbackMTD))asunknownas[SQLResults[]];// I've also tries this, but it isn't working either//const [result] = await database.execute<SQLResults>(csFeedbackMTD);
The text was updated successfully, but these errors were encountered:
Feature hasn't been suggested before.
Describe the enhancement you want to request
How do I specify the types for a raw sql statement? I have the following code, but I have to override the types to unknown before I can get the types out.
The text was updated successfully, but these errors were encountered: