Skip to main content

Module table

Module table 

Source
Expand description

Table traits, database connection helpers, and shared table constants.

§Streaming API

The streaming API processes each row through a callback without collecting the table into a Vec.

use imessage_database::{
   error::table::TableError,
   tables::{
       table::{get_connection, Table},
       messages::Message,
   },
   util::dirs::default_db_path
};

let db_path = default_db_path();
let db = get_connection(&db_path).unwrap();

Message::stream(&db, |message_result| {
    match message_result {
        Ok(message) => println!("Message: {:#?}", message),
        Err(e) => eprintln!("Error: {:?}", e),
    }
   Ok::<(), TableError>(())
}).unwrap();

The callback may return any error type that implements From<TableError>.

Constants§

ATTACHMENT
Attachment table name.
ATTACHMENTS_DIR
Attachments directory name used in exports.
ATTRIBUTED_BODY
typedstream-encoded attributed body column.
ATTRIBUTION_INFO
plist-encoded attachment attribution column.
CHAT
Chat table name.
CHAT_HANDLE_JOIN
Chat-to-handle join table name.
CHAT_MESSAGE_JOIN
Chat-to-message join table name.
DEFAULT_PATH_IOS
Default Messages database path inside an iOS backup.
DEFAULT_PATH_MACOS
Default macOS Messages database path.
FITNESS_RECEIVER
Replacement token found in Fitness.app messages.
HANDLE
Handle table name.
ME
First-person display name for the database owner.
MESSAGE
Message table name.
MESSAGE_ATTACHMENT_JOIN
Message-to-attachment join table name.
MESSAGE_PAYLOAD
plist-encoded app-message payload column.
MESSAGE_SUMMARY_INFO
plist-encoded message summary column.
ORPHANED
Chat name reserved for messages that do not belong to a chat row.
PROPERTIES
plist-encoded chat properties column.
RECENTLY_DELETED
Recently deleted messages table.
STICKER_USER_INFO
plist-encoded sticker metadata column.
UNKNOWN
Display name used when a contact or chat name is unavailable.
YOU
Second-person display name for the database owner.

Traits§

Cacheable
Table data that can be materialized into an in-memory map.
Table
Database table model that can deserialize itself from SQLite rows.

Functions§

get_connection
Open the Messages SQLite database read-only.
get_db_size
Return the database file size on disk.