pub struct Capabilities {
pub filter_actions: bool,
pub recoverable_messages: bool,
pub replies: bool,
pub associated_message_guids: bool,
/* private fields */
}Expand description
Features of a Messages database schema, probed from the live database.
Each flag guards the SQL constructs that reference its column or table:
when a flag is false, composed queries substitute a neutral placeholder
so deserialization behaves uniformly across schemas.
Fields§
§filter_actions: boolBoth filter_action and filter_sub_action exist on message.
The pair is one feature: queries project either both real columns or
two NULL placeholders. A schema carrying only one of the pair reads
None for both, keeping FilterAction
parsing off partial data.
recoverable_messages: boolThe chat_recoverable_message_join table exists, so recently deleted
messages can be identified and filtered.
replies: boolthread_originator_guid exists on message, so replies can be counted
and grouped.
associated_message_guids: boolassociated_message_guid exists on message, so tapbacks and poll
votes can be resolved.
Implementations§
Source§impl Capabilities
impl Capabilities
Sourcepub fn determine(db: &Connection) -> Result<Self, TableError>
pub fn determine(db: &Connection) -> Result<Self, TableError>
Probe the schema of the supplied database.
Sourcepub fn without_derived_features(&self) -> Self
pub fn without_derived_features(&self) -> Self
Return a copy with the row-enrichment features disabled:
recoverable_messages, replies, and filter_actions.
Narrow scans that only need the base projection (e.g. the tapback cache) use this to skip correlated subqueries and joins those features would add.
Sourcepub fn without_body_inputs(&self) -> Self
pub fn without_body_inputs(&self) -> Self
Return a copy whose message projection omits the body-parser inputs:
attributedBody, message_summary_info, and payload_data.
Row decoding parses a body only from projected bytes, so a scan that never renders its rows uses this to skip the blob reads and the typedstream decode for every row.
Sourcepub fn message_columns(&self) -> &[&'static str]
pub fn message_columns(&self) -> &[&'static str]
Recognized message columns this schema declares, in canonical order.
Sourcepub fn attachment_columns(&self) -> &[&'static str]
pub fn attachment_columns(&self) -> &[&'static str]
Recognized attachment columns this schema declares, in canonical order.