MCPcopy Index your code
hub / github.com/TanStack/db / compileOrderBy

Function compileOrderBy

packages/powersync-db-collection/src/sqlite-compiler.ts:121–130  ·  view source on GitHub ↗

* Compiles an OrderBy array to a SQL ORDER BY clause.

(
  orderBy: IR.OrderBy,
  params: Array<unknown>,
  compileOptions?: CompileSQLiteOptions,
)

Source from the content-addressed store, hash-verified

119 * Compiles an OrderBy array to a SQL ORDER BY clause.
120 */
121function compileOrderBy(
122 orderBy: IR.OrderBy,
123 params: Array<unknown>,
124 compileOptions?: CompileSQLiteOptions,
125): string {
126 const clauses = orderBy.map((clause: IR.OrderByClause) =>
127 compileOrderByClause(clause, params, compileOptions),
128 )
129 return clauses.join(`, `)
130}
131
132/**
133 * Compiles a single OrderByClause to SQL.

Callers 1

compileSQLiteFunction · 0.70

Calls 3

compileOrderByClauseFunction · 0.70
mapMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected