Zero dependencies Query Builder for Cloudflare Workers
Full Changelog: https://github.com/G4brym/workers-qb/compare/v1.2.1...v1.2.2
fields
now defaults to *
when left undefinedwhere
interface when calling without arguments, the interface is still the same when calling with parametersconst fetched = await qb
.fetchAll({
tableName: 'employees',
where: ['active = true', 'department = "HR"'],
})
.execute()
// The example above is the same as this
const fetched = await qb
.fetchAll({
tableName: 'employees',
fields: '*',
where: {
conditions: ['active = true', 'department = "HR"'],
},
})
.execute()
Full Changelog: https://github.com/G4brym/workers-qb/compare/v1.2.0...v1.2.1
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: https://github.com/G4brym/workers-qb/compare/v1.1.1...v1.2.0
Full Changelog: https://github.com/G4brym/workers-qb/compare/v1.1.0...v1.1.1
Full Changelog: https://github.com/G4brym/workers-qb/compare/v1.0.2...v1.1.0
Full Changelog: https://github.com/G4brym/workers-qb/compare/v1.0.1...v1.0.2
Full Changelog: https://github.com/G4brym/workers-qb/compare/v1.0.0...v1.0.1
.execute()
at the end of every query, read more here
Full Changelog: https://github.com/G4brym/workers-qb/compare/v0.1.12...v1.0.0
Full Changelog: https://github.com/G4brym/workers-qb/compare/v0.1.11...v0.1.12
Full Changelog: https://github.com/G4brym/workers-qb/compare/v0.1.10...v0.1.11