Created
May 19, 2024 10:29
-
-
Save javahippie/e0988419f01327545835cd05d2665230 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
INSTALL json; | |
LOAD json; | |
INSTALL sqlite; | |
LOAD sqlite; | |
ATTACH 'messages.db' AS sqlite_db (TYPE SQLITE); | |
CREATE TABLE sqlite_db.messages (name VARCHAR, text VARCHAR, ts VARCHAR, channel VARCHAR); | |
INSERT INTO sqlite_db.messages (SELECT user_profile.real_name as name, | |
text, | |
ts, | |
regexp_extract(filename, '^slack-export/(.*)/', 1) as channel | |
FROM read_json_auto('slack-export/**/*.json', | |
filename = true)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment