Function: commitIsDescendantOf()

commitIsDescendantOf(commit: Pick<LixCommit, "id">, options?: { depth?: number; includeSelf?: boolean; }): (eb: ExpressionBuilder<LixDatabaseSchema, "commit">) => ExpressionWrapper<LixDatabaseSchema, "commit", SqlBool>

Filters commits that are descendants of the given commit.

By default, this is exclusive, meaning it returns only commits strictly after the provided commit in the graph.

Traverses the commit_edge graph recursively, starting from the provided commit (or its children if exclusive), and returns all commits reachable via child edges.

This filter is useful for finding changes made after a specific point in time (e.g., a checkpoint).

⚠️ This filter only defines the traversal scope — it does not filter changes directly.

--- Options ---

  • includeSelf: If true, includes the starting commit in the results. Defaults to false.
  • depth: Limits the traversal depth. depth: 1 selects only immediate children (if exclusive) or the starting node and its immediate children (if includeSelf is true).

--- Examples ---

Examples

db.selectFrom("commit")
  .where(commitIsDescendantOf({ id: "c1" }))
  .selectAll()
// Select all commits between startPoint and endPoint (inclusive)
db.selectFrom("commit")
  .where(commitIsDescendantOf({ id: "startPoint" }))
  .where(commitIsAncestorOf({ id: "endPoint" }))
  .selectAll()

Parameters

ParameterType
commitPick<LixCommit, "id">
options?{ depth?: number; includeSelf?: boolean; }
options.depth?number
options.includeSelf?boolean

Returns

(eb: ExpressionBuilder<LixDatabaseSchema, "commit">): ExpressionWrapper<LixDatabaseSchema, "commit", SqlBool>

Parameters

ParameterType
ebExpressionBuilder<LixDatabaseSchema, "commit">

Returns

ExpressionWrapper<LixDatabaseSchema, "commit", SqlBool>