Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 874 Bytes

File metadata and controls

38 lines (25 loc) · 874 Bytes
id parseOrderByExpression
title parseOrderByExpression

Function: parseOrderByExpression()

function parseOrderByExpression(orderBy): ParsedOrderBy[];

Defined in: packages/db/src/query/expression-helpers.ts:265

Parses an ORDER BY expression into a simple array of sort specifications.

Parameters

orderBy

The ORDER BY expression array

OrderBy | null | undefined

Returns

ParsedOrderBy[]

Array of parsed order by specifications

Example

const sorts = parseOrderByExpression(orderBy)
// Returns: [
//   { field: ['category'], direction: 'asc', nulls: 'last' },
//   { field: ['price'], direction: 'desc', nulls: 'last' }
// ]