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.
|
@@ -309,7 +309,11 @@ class QueryCompiler {
|
|
|
309
309
|
) AS ${{ identifier: fetchName }}
|
|
310
310
|
${!_.isEmpty(filter) ? sql `WHERE ${{ literal: _.map(filter, x => sql `(${x})`), separator: ' AND ' }}` : sql ``}
|
|
311
311
|
${_options?.sort ? _options?.sort : sql ``}
|
|
312
|
-
${!_.isEmpty(query.sort) ? sql `ORDER BY ${this._encodeSort(query.sort, {
|
|
312
|
+
${!_.isEmpty(query.sort) ? sql `ORDER BY ${this._encodeSort(query.sort, {
|
|
313
|
+
name: fetchName,
|
|
314
|
+
className: query.className,
|
|
315
|
+
groupMatches: query.groupMatches,
|
|
316
|
+
})}` : sql ``}
|
|
313
317
|
${query.limit ? sql `LIMIT ${{ literal: `${query.limit}` }}` : sql ``}
|
|
314
318
|
${query.skip ? sql `OFFSET ${{ literal: `${query.skip}` }}` : sql ``}
|
|
315
319
|
`,
|
|
@@ -1937,7 +1941,7 @@ const _selectRelationPopulate = (compiler, parent, populate, field, encode) => {
|
|
|
1937
1941
|
index.isRelation(type) && sql `${{ identifier: populate.name }}.${{ identifier: `$${path}` }}`,
|
|
1938
1942
|
]))}
|
|
1939
1943
|
FROM ${{ identifier: populate.name }} WHERE ${cond}
|
|
1940
|
-
${!_.isEmpty(populate.sort) ? sql `ORDER BY ${compiler._encodeSort(populate.sort,
|
|
1944
|
+
${!_.isEmpty(populate.sort) ? sql `ORDER BY ${compiler._encodeSort(populate.sort, populate)}` : sql ``}
|
|
1941
1945
|
${populate.limit ? sql `LIMIT ${{ literal: `${populate.limit}` }}` : sql ``}
|
|
1942
1946
|
${populate.skip ? sql `OFFSET ${{ literal: `${populate.skip}` }}` : sql ``}
|
|
1943
1947
|
${compiler.selectLock ? compiler.isUpdate ? sql `FOR UPDATE NOWAIT` : sql `FOR SHARE NOWAIT` : sql ``}
|