Skip to content

v1.12.0

Choose a tag to compare

@G4brym G4brym released this 18 Jan 17:09
· 9 commits to main since this release
805fc19

What's Changed

You can now get type inference without having to always specify the table schema, just specify once when initialing the
query builder, and then get type autocomplete on tablename, fields, order by and return types, example:

import {D1QB} from 'workers-qb';

type Schema = {
users: {
  id: number;
  name: string;
  email: string;
};
};

const qb = new D1QB<Schema>(env.DB);

const allUsers = await qb.fetchAll({
tableName: 'users',
}).execute();                                                                                                                                                                                                                                                                                                           

Full Changelog: v1.11.2...v1.12.0