MCPcopy Create free account
hub / github.com/TanStack/db / coalesce

Function coalesce

packages/db/src/query/builder/functions.ts:349–356  ·  view source on GitHub ↗
(
  ...args: T
)

Source from the content-addressed store, hash-verified

347 : BasicExpression<CoalesceArgTypes<T> | null>
348
349export function coalesce<T extends [ExpressionLike, ...Array<ExpressionLike>]>(
350 ...args: T
351): CoalesceReturnType<T> {
352 return new Func(
353 `coalesce`,
354 args.map((arg) => toExpression(arg)),
355 ) as CoalesceReturnType<T>
356}
357
358/**
359 * Returns the value for the first matching condition, similar to SQL

Callers 10

includes.test.tsFile · 0.85
createDerivedCollectionFunction · 0.85
union-all.test.tsFile · 0.85
createGroupByTestsFunction · 0.85
createWhereTestsFunction · 0.85
functions.test.tsFile · 0.85

Calls 2

toExpressionFunction · 0.85
mapMethod · 0.45

Tested by 3

createDerivedCollectionFunction · 0.68
createGroupByTestsFunction · 0.68
createWhereTestsFunction · 0.68