Skip to content

Instantly share code, notes, and snippets.

@canabady
Created October 17, 2017 06:11
Show Gist options
  • Save canabady/28cd7a020b18b14cea5b4afda7de70ad to your computer and use it in GitHub Desktop.
Save canabady/28cd7a020b18b14cea5b4afda7de70ad to your computer and use it in GitHub Desktop.
======================================
sqlite3 preview in Ranger file Manager
======================================
To preview every *.db, *.sqlite file in Ranger File Manager,
You can add the following to the
case "$extension" in
in Your scope.sh:
db|sqlite)
sqlite3 "$path" "SELECT name FROM sqlite_master WHERE type='table';" | xargs -I {} bash -c 'echo "{}:" ; sqlite3 '"$path"' -header -column "SELECT * FROM {}; " ; echo "" ' ; exit 0;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment