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

Method insert

packages/db/src/utils/btree.ts:843–846  ·  view source on GitHub ↗

* Inserts `child` at index `i`. * This does not mark `child` as shared, so it is the responsibility of the caller * to ensure that either child is marked shared, or it is not included in another tree.

(i: index, child: BNode<K, V>)

Source from the content-addressed store, hash-verified

841 * to ensure that either child is marked shared, or it is not included in another tree.
842 */
843 insert(i: index, child: BNode<K, V>) {
844 this.children.splice(i, 0, child)
845 this.keys.splice(i, 0, child.maxKey()!)
846 }
847
848 /**
849 * Split this node.

Callers 15

setMethod · 0.95
seedCollectionFunction · 0.45
insertRowIntoCollectionsFunction · 0.45
seedCollectionFunction · 0.45
insertRowIntoCollectionsFunction · 0.45
seedCollectionFunction · 0.45
insertRowIntoCollectionsFunction · 0.45

Calls 1

maxKeyMethod · 0.45

Tested by 6

seedCollectionFunction · 0.36
insertRowIntoCollectionsFunction · 0.36
seedCollectionFunction · 0.36
insertRowIntoCollectionsFunction · 0.36
seedCollectionFunction · 0.36
insertRowIntoCollectionsFunction · 0.36