There is a draft PR that started this, but it needs finishing off. The goal here is to make it type safe, which might mean defining the DB schema for the query builder to use (in a similar way to Drizzle). There isn't a need to consider migrations at this point though.