
Read: and which tell us that message text is now in message_summary_info. Whilst the above SQL executes correctly, it does not show the message text for new messages. Best of luck.įor iOS16/macOS13, there are some changes to chat.db to support new features of Messages. That is a rather deep plunge into SQLite.

The mode and output commands make sure that the output goes to a CSV file which you can open in a spreadsheet. > (h2.service is null or m.service = h2.service) > - try to eliminate duplicates due to non-unique message.cache_roomnames/chat.room_name > left join handle as h2 on ch.handle_id = h2.rowid > left join chat_handle_join as ch on c.rowid = ch.chat_id > left join chat as c on m.cache_roomnames = c.room_name /* note: chat.room_name is not unique, this may cause one-to-many join */ > left join handle as h on m.handle_id = h.rowid > /*,datetime(m.date + 978307200, 'unixepoch', 'localtime') as TextDate - date stored as ticks since */ > else coalesce(h2.id, h.id) end as ToPhoneNumber > ,case when m.is_from_me = 0 then m.account > ,case when m.is_from_me = 1 then m.account > ,coalesce(m.cache_roomnames, h.id) ThreadId Or you can do it in Terminal with a few incredibly detailed and finicky / unforgiving-of-even-a-single-typo commands: sqlite3 chat.db You can use different applications - I have used dbHarbour (free, I think). I can then see all my messages (I have squashed up some of the columns to partially hide my content): (h2.service is null or m.service = h2.service) try to eliminate duplicates due to non-unique message.cache_roomnames/chat.room_name Left join handle as h2 on ch.handle_id = h2.rowid Left join chat_handle_join as ch on c.rowid = ch.chat_id Left join chat as c on m.cache_roomnames = c.room_name /* note: chat.room_name is not unique, this may cause one-to-many join */ Left join handle as h on m.handle_id = h.rowid *,datetime(m.date + 978307200, 'unixepoch', 'localtime') as TextDate - date stored as ticks since */ ,case when m.is_from_me = 0 then m.accountĮlse coalesce(h2.id, h.id) end as ToPhoneNumber ,case when m.is_from_me = 1 then m.account ,coalesce(m.cache_roomnames, h.id) ThreadId Make a copy of the database - I copied mine to the Desktop.

I have "cheated" and found one here SQL query for chat. An application - I use "SQLPro for SQLite" from the Apple App Store.To make sense of a SQLite database, you need: The power (and complexity) of relational databases comes with connecting data in two or more tables via relationships. A "relational database" organises data into one or more tables (or "relations") of rows and columns.
#DB FILE READER MAC#
You have many choices - search in the Mac App Store for SQLite (or similar) or use the Terminal command sqlite3.īut a SQLite database is intimidating to the first time user, even though it is amongst the simplest of relational databases. The file you have found is a SQLite database and you need an application which can read SQLite databases.
