Skip to main content

Module table

Module table 

Source
Expand description

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

§Row iteration

Prepare a statement with the appropriate table type, then use Table::rows to decode one row at a time. Use any statement that selects the table’s columns.

use imessage_database::{
   tables::{handle::Handle, table::{Table, get_connection}},
   util::dirs::default_db_path,
};

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

let mut statement = Handle::get(&db).unwrap();
for handle_result in Handle::rows(&mut statement, []).unwrap() {
    match handle_result {
        Ok(handle) => println!("Handle: {}", handle.id),
        Err(e) => eprintln!("Error: {:?}", e),
    }
}

Constants§

ATTACHMENT
Attachment table name.
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.
PROPERTIES
plist-encoded chat properties column.
RECENTLY_DELETED
Recently deleted messages table.
STICKER_USER_INFO
plist-encoded sticker metadata column.

Traits§

Table
Deserialize a database record from a stepped SQLite row.

Functions§

get_connection
Open the Messages SQLite database read-only.
get_db_size
Return the database file size on disk.
open_blob
Open a BLOB column for rowid, read-only.