Skip to content

Instantly share code, notes, and snippets.

@jlroo
jlroo / chat.sql
Created February 26, 2025 14:51 — forked from jkeen/chat.sql
iMessage chat.db deciphering
SELECT
m.rowid as message_id,
(SELECT chat_id FROM chat_message_join WHERE chat_message_join.message_id = m.rowid) as message_group,
CASE p.participant_count
WHEN 0 THEN "???"
WHEN 1 THEN "Individual"
ELSE "Group"
END AS chat_type,
DATETIME(date +978307200, 'unixepoch', 'localtime') AS date,
CASE is_from_me