fsql

Forum rules
General talk about software - if the program is not in the repos, please links to the developer's page or github.
User avatar
franksinistra
Ivana Fukalot
Posts: 1093
Joined: Mon Jan 27, 2014 2:03 am
Location: 印尼国

fsql

Unread post by franksinistra » Fri May 26, 2017 12:46 pm

https://github.com/kshvmdn/fsql

Search files under any directory with SQL-like syntax. Useful stuff.
rice no more.

User avatar
wuxmedia
Grasshopper
Posts: 6445
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: fsql

Unread post by wuxmedia » Sun May 28, 2017 10:34 pm

OMG I might even get good at SQL...
what happens if one types drop tables? and how about... oh it's only search...
how about putting fucking grep into the mysql command line, that'd be good.... i suppose do a mysql command on the bash shell and grep it.
"Seek, and Ye shall find"
"Github | Chooons | Site"

User avatar
franksinistra
Ivana Fukalot
Posts: 1093
Joined: Mon Jan 27, 2014 2:03 am
Location: 印尼国

Re: fsql

Unread post by franksinistra » Mon May 29, 2017 9:03 am

how about putting fucking grep into the mysql command line
exactly how i feel......
rice no more.

User avatar
wuxmedia
Grasshopper
Posts: 6445
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: fsql

Unread post by wuxmedia » Tue May 30, 2017 12:05 pm

^ yes- although I was pleased to see Ctrl -r works as expected (searches previous commands) :D
my solution is to run in tmux (all the servers are) and hit copy mode and do a search from there.

Code: Select all

mysql --user="$user" --password="$password" --database="$user" --execute='select * in wp_posts;'
works piped to grep, but what a mouthful...
this is the other way someone showed me at work:

Code: Select all

rgrep -l "searchterm" /var/lib/mysql/user/*
to find table, then:

Code: Select all

strings wp_options.* | grep <searchterm>
to narrow it down
"Seek, and Ye shall find"
"Github | Chooons | Site"

User avatar
franksinistra
Ivana Fukalot
Posts: 1093
Joined: Mon Jan 27, 2014 2:03 am
Location: 印尼国

Re: fsql

Unread post by franksinistra » Tue May 30, 2017 5:19 pm

^ I used to do mysqldump to /tmp and grep from there, works pretty nice until a co-worker made a nice ORM wrapper for it.
rice no more.

Post Reply