Via Simon Willison’s TIL.
I used it like this to query CSV data:
sqlite3 :memory: -cmd '.mode csv' -cmd '.import export.csv data' "select URL from data where URL like '%google%q=%'" | rg 'q=(.+?)&' -o -r '$1' | tr '+' ' ' | sort | uniq