Skip to content

v1.2.0

Choose a tag to compare

@G4brym G4brym released this 28 Feb 23:19
· 103 commits to main since this release

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].name

Full Changelog: v1.1.1...v1.2.0