Function: changeSetIsAncestorOf()

changeSetIsAncestorOf(changeSet, options?): (eb) => ExpressionWrapper<LixDatabaseSchema, "change_set", SqlBool>

Filters change sets that are ancestors of the given change set.

By default, this is exclusive, meaning it returns only change sets strictly before the provided change set in the graph.

Traverses the change_set_edge graph recursively, starting from the provided change set (or its parents if exclusive), and returns all change sets reachable via parent edges.

This filter is typically used to scope the graph before applying filters like changeIsLeaf().

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

--- Options ---

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

--- Examples ---

Parameters

changeSet

Pick<ChangeSet, "id">

options?

depth?

number

includeSelf?

boolean

Returns

(eb): ExpressionWrapper<LixDatabaseSchema, "change_set", SqlBool>

Parameters

eb

ExpressionBuilder<LixDatabaseSchema, "change_set">

Returns

ExpressionWrapper<LixDatabaseSchema, "change_set", SqlBool>

Examples

db.selectFrom("change_set")
  .where(changeSetIsAncestorOf({ id: "cs3" }))
  .selectAll()
db.selectFrom("change_set")
  .where(changeSetIsAncestorOf({ id: "cs3" }, { includeSelf: true }))
  .selectAll()
// Select all change sets between startPoint and endPoint (inclusive)
db.selectFrom("change_set")
  .where(changeSetIsDescendantOf({ id: "startPoint" }))
  .where(changeSetIsAncestorOf({ id: "endPoint" }))
  .selectAll()