proto.io 0.0.212 → 0.0.213

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -305,7 +305,11 @@ class QueryCompiler {
305
305
  ) AS ${{ identifier: fetchName }}
306
306
  ${!_.isEmpty(filter) ? sql `WHERE ${{ literal: _.map(filter, x => sql `(${x})`), separator: ' AND ' }}` : sql ``}
307
307
  ${_options?.sort ? _options?.sort : sql ``}
308
- ${!_.isEmpty(query.sort) ? sql `ORDER BY ${this._encodeSort(query.sort, { className: query.className, name: fetchName })}` : sql ``}
308
+ ${!_.isEmpty(query.sort) ? sql `ORDER BY ${this._encodeSort(query.sort, {
309
+ name: fetchName,
310
+ className: query.className,
311
+ groupMatches: query.groupMatches,
312
+ })}` : sql ``}
309
313
  ${query.limit ? sql `LIMIT ${{ literal: `${query.limit}` }}` : sql ``}
310
314
  ${query.skip ? sql `OFFSET ${{ literal: `${query.skip}` }}` : sql ``}
311
315
  `,
@@ -1933,7 +1937,7 @@ const _selectRelationPopulate = (compiler, parent, populate, field, encode) => {
1933
1937
  isRelation(type) && sql `${{ identifier: populate.name }}.${{ identifier: `$${path}` }}`,
1934
1938
  ]))}
1935
1939
  FROM ${{ identifier: populate.name }} WHERE ${cond}
1936
- ${!_.isEmpty(populate.sort) ? sql `ORDER BY ${compiler._encodeSort(populate.sort, { className: populate.className, name: populate.name })}` : sql ``}
1940
+ ${!_.isEmpty(populate.sort) ? sql `ORDER BY ${compiler._encodeSort(populate.sort, populate)}` : sql ``}
1937
1941
  ${populate.limit ? sql `LIMIT ${{ literal: `${populate.limit}` }}` : sql ``}
1938
1942
  ${populate.skip ? sql `OFFSET ${{ literal: `${populate.skip}` }}` : sql ``}
1939
1943
  ${compiler.selectLock ? compiler.isUpdate ? sql `FOR UPDATE NOWAIT` : sql `FOR SHARE NOWAIT` : sql ``}