Dynamic select with types?

Does anyone know how to do this correctly? Example:

async t<T>(select: Something) {
    return db.select(select).from(table);
}

const data: { id: number; }[] = t<{ id: number; }[]>({ id: table.id });
Was this page helpful?