Skip to content

perf(sqlite): add placement order_key UDF (fixes #66)#67

Draft
marcus-pousette wants to merge 1 commit intofix/playground-order-keyfrom
fix/sqlite-placement-udf
Draft

perf(sqlite): add placement order_key UDF (fixes #66)#67
marcus-pousette wants to merge 1 commit intofix/playground-order-keyfrom
fix/sqlite-placement-udf

Conversation

@marcus-pousette
Copy link
Copy Markdown
Collaborator

Fixes #66.

  • Adds treecrdt_allocate_order_key(parent, placement, after, exclude, seed) to the SQLite extension.
  • Moves sibling-boundary lookup + allocate_between into the extension (single SQL call).
  • Updates @treecrdt/interface SQLite local writer to call the UDF (removes boundary SQL + TS placement logic).
  • Adds extension tests covering first/last/after/exclude + TRASH.

Notes:

  • The UDF calls treecrdt_ensure_materialized() internally before reading tree_nodes.
  • Callers should pass placement as first|last|after and pass after only for after placement; pass exclude to ignore a moving node.

@marcus-pousette marcus-pousette marked this pull request as draft January 25, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant