const model = MyModel.scope(scopes);
const { queryGenerator } = model;
const queryOptions = {
scopes,
attributes,
include,
where,
order,
offset,
limit,
};
model._validateIncludedElements.bind(model)(queryOptions);
const cte = queryGenerator.selectQuery(
model.getTableName(),
queryOptions,
model
)
.slice(0, -1);
I have two issue with the query generator
- The scope is ignored (Including default scope), How can I apply scopes in the query generator?
- The attributes are in camel case instead of snack case