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
constresult: postgres.RowList<postgres.Row[]>Type'RowList<Row[]>'isnotassignabletotype'{ name: string; }[]'.Thetypesreturnedby'pop()'areincompatiblebetweenthesetypes.Type 'Row|undefined' is not assignable to type '{name: string;}|undefined'.Property'name'ismissingintype'Row'butrequiredintype'{ name: string; }'.ts(2322)
Query:
SELECT
name
FROM projects
WHERE id = ${projectID}
Generated code:
// Generated by sqltyper from get_project.sql.// Do not edit directly. Instead, edit get_project.sql and re-run sqltyper.import*aspostgresfrom'postgres'exportasyncfunctiongetProject(sql: postgres.Sql<{}>,params: {projectID: number}): Promise<Array<{name: string}>>{constresult=awaitsql.unsafe(`SELECT nameFROM projectsWHERE id = $1`,[params.projectID])returnresult}
The text was updated successfully, but these errors were encountered:
Which version of postgres.js are you using? sqltyper uses it internally too, but it might not be exactly the latest version, because it had to be patched a bit.
Tried to use with
Postgres.js
TypeScript error:
Query:
Generated code:
The text was updated successfully, but these errors were encountered: