v1.2.0
What's Changed
- Add sql results type hints
type Employee = {
name: string
role: string
level: number
}
// Send your table type in every query like this:
const employeeList = await qb
.fetchAll<Employee>({
tableName: 'employees',
fields: '*',
where: {
conditions: 'active = ?1',
params: [true],
},
})
.execute()
// You will then get type hints inside results in the shape of your table:
employeeList.results[0].nameFull Changelog: v1.1.1...v1.2.0