···4747 -- Roots don't have root/prev refs
4848 '' as root_did,
4949 '' as root_rkey,
5050+ '' as root_cid,
5051 '' as prev_did,
5152 '' as prev_rkey,
5353+ '' as prev_cid,
52545355 -- Roots always have snapshot
5456 0 as has_inline_diff,
···4444 ''
4545 ) as resource_collection,
46464747- -- Root reference
4747+ -- Root reference (StrongRef: uri + cid)
4848 splitByChar('/', replaceOne(toString(record.root.uri), 'at://', ''))[1] as root_did,
4949 splitByChar('/', replaceOne(toString(record.root.uri), 'at://', ''))[3] as root_rkey,
5050+ toString(record.root.cid) as root_cid,
50515151- -- Prev reference (optional)
5252+ -- Prev reference (optional StrongRef)
5253 if(toString(record.prev.uri) != '',
5354 splitByChar('/', replaceOne(toString(record.prev.uri), 'at://', ''))[1],
5455 '') as prev_did,
5556 if(toString(record.prev.uri) != '',
5657 splitByChar('/', replaceOne(toString(record.prev.uri), 'at://', ''))[3],
5758 '') as prev_rkey,
5959+ if(toString(record.prev.uri) != '',
6060+ toString(record.prev.cid),
6161+ '') as prev_cid,
58625963 -- Check for inline diff vs snapshot
6064 if(length(toString(record.inlineDiff)) > 0, 1, 0) as has_inline_diff,
+2-1
crates/weaver-index/src/clickhouse.rs
···77pub use client::{Client, TableSize};
88pub use migrations::{DbObject, MigrationResult, Migrator, ObjectType};
99pub use queries::{
1010- EntryRow, HandleMappingRow, NotebookRow, ProfileCountsRow, ProfileRow, ProfileWithCounts,
1010+ CollaboratorRow, EditHeadRow, EditNodeRow, EntryRow, HandleMappingRow, NotebookRow,
1111+ ProfileCountsRow, ProfileRow, ProfileWithCounts,
1112};
1213pub use resilient_inserter::{InserterConfig, ResilientRecordInserter};
1314pub use schema::{
+6
crates/weaver-index/src/clickhouse/queries.rs
···22//!
33//! These modules add query methods to the ClickHouse Client via impl blocks.
4455+mod collab;
66+mod collab_state;
57mod contributors;
88+mod edit;
69mod identity;
710mod notebooks;
811mod profiles;
9121313+pub use collab::PermissionRow;
1414+pub use collab_state::{CollaboratorRow, EditHeadRow};
1515+pub use edit::EditNodeRow;
1016pub use identity::HandleMappingRow;
1117pub use notebooks::{EntryRow, NotebookRow};
1218pub use profiles::{ProfileCountsRow, ProfileRow, ProfileWithCounts};