Expand description
This module defines traits for table representations and stores some shared table constants.
§Zero-Allocation Streaming API
This module provides zero-allocation streaming capabilities for all database tables through a callback-based API.
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();Note: you can substitute TableError with your own error type if you want to handle errors differently. See the Table::stream method for more details.
Constants§
- ATTACHMENT
- Attachment table name
- ATTACHMENTS_
DIR - Name for attachments directory in exports
- ATTRIBUTED_
BODY - The
attributedBodycolumn containstypedstream-encoded a message’s body text with many other attributes - ATTRIBUTION_
INFO - The attribution info contains
plist-encoded metadata for sticker attachments - 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 location for the Messages database in an iOS backup
- DEFAULT_
PATH_ MACOS - Default location for the Messages database on macOS
- FITNESS_
RECEIVER - Replacement text sent in Fitness.app messages
- HANDLE
- Handle table name
- ME
- Name used for messages sent by the database owner in a first-person context
- MESSAGE
- Message table name
- MESSAGE_
ATTACHMENT_ JOIN - Message to attachment join table name
- MESSAGE_
PAYLOAD - The payload data column contains
plist-encoded app message data - MESSAGE_
SUMMARY_ INFO - The message summary info column contains
plist-encoded edited message information - ORPHANED
- Chat name reserved for messages that do not belong to a chat in the table
- PROPERTIES
- The properties column contains
plist-encoded metadata for a chat - RECENTLY_
DELETED - Recently deleted messages table
- STICKER_
USER_ INFO - The sticker user info column contains
plist-encoded metadata for sticker attachments - UNKNOWN
- Name used for contacts or chats where the name cannot be discovered
- YOU
- Name used for messages sent by the database owner in a second-person context
Traits§
- Cacheable
- Defines behavior for table data that can be cached in memory
- Deduplicate
- Defines behavior for deduplicating data in a table
- Diagnostic
- Defines behavior for printing diagnostic information for a table
- Table
- Defines behavior for SQL Table data
Functions§
- get_
connection - Get a connection to the iMessage
SQLitedatabase - get_
db_ size - Get the size of the database on the disk