#class QueryBuilder
QueryBuilder is the most important component in objection. Every method that allows you to fetch or modify items in the database returns an instance of theQueryBuilder.
QueryBuilder is a wrapper aroundknex QueryBuilder(opens new window). QueryBuilder has all the methods a knex QueryBuilder has and more. While knex QueryBuilder returns plain JavaScript objects, QueryBuilder returns Model subclass instances.
QueryBuilder is thenable, meaning that it can be used like a promise. You canawait a query builder, and it will get executed. You can return query builder from athen method of a promise and it gets chained just like a normal promise would.
See also