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
WITH tokens AS ( | |
-- Just edit MY_TABLE, MY_TEXT_COL, and MY_PKEY_COL, and watch it go! | |
SELECT MY_PKEY_COL AS pkey, (unnest(to_tsvector(MY_TEXT_COL))).* FROM MY_TABLE | |
), token_stream AS ( | |
SELECT pkey, unnest(positions) AS token_idx, lexeme | |
FROM tokens ORDER BY pkey, token_idx | |
), token_counts AS ( | |
SELECT lexeme, sum(count) AS count | |
FROM ( | |
SELECT lexeme, array_length(positions, 1) AS count FROM tokens |
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
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')" | |
# syntax = docker/dockerfile:1.4.0 | |
FROM node:20 | |
WORKDIR /root | |
RUN npm install sqlite3 |
OlderNewer