Last active
September 22, 2019 23:30
-
-
Save jbis9051/db3c14b77b5ba132653ad9cd19415c1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.all('SELECT `chat`.`chat_identifier`,`chat`.`ROWID`,`chat`.`service_name` FROM `chat`').then(chats => { | |
chats.forEach(chat => { | |
db.all(`SELECT message.text,message.\`is_from_me\`,message.service,message.date FROM chat_message_join INNER JOIN message ON chat_message_join.message_id = message.ROWID WHERE chat_message_join.chat_id = ${chat.ROWID} ORDER BY message.date ASC`).then(messages => { | |
addThread(chat.chat_identifier, chat.ROWID, chat.service_name, messages) | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment