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
SQLitedatabase read-only. - get_
db_ size - Return the database file size on disk.