MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / pb_place_table_cell

Function pb_place_table_cell

internal/cbm/sqlite_writer.c:1153–1166  ·  view source on GitHub ↗

Put a finished table cell on the current leaf, flushing a full leaf first.

Source from the content-addressed store, hash-verified

1151
1152// Put a finished table cell on the current leaf, flushing a full leaf first.
1153static bool pb_place_table_cell(PageBuilder *pb, const uint8_t *cell, int cell_len,
1154 int64_t prev_rowid) {
1155 if (!pb_cell_fits(pb, cell_len) && pb->cell_count > 0) {
1156 if (!pb_ensure_leaf_cap(pb)) {
1157 return false;
1158 }
1159 pb->leaves[pb->leaf_count].max_key = prev_rowid;
1160 pb->leaves[pb->leaf_count].sep_cell = NULL;
1161 pb->leaves[pb->leaf_count].sep_cell_len = 0;
1162 pb_flush_leaf(pb);
1163 }
1164 pb_add_cell(pb, cell, cell_len);
1165 return true;
1166}
1167
1168// Add a table cell to the PageBuilder, flushing leaf pages as needed.
1169// If the payload exceeds max_local, overflow pages are written and only the

Callers 2

Calls 4

pb_cell_fitsFunction · 0.85
pb_ensure_leaf_capFunction · 0.85
pb_flush_leafFunction · 0.85
pb_add_cellFunction · 0.85

Tested by

no test coverage detected