jhspetersson / fselect

Find files with SQL-like queries
https://fselect.rocks
Apache License 2.0
4.02k stars 85 forks source link

Suggestion for how to compare contents of two paths? #124

Open shah opened 2 years ago

shah commented 2 years ago

This is a fantastic little utility, thanks for putting it together! One of my projects (a statically generated site with over 100k files) has a "audit" requirement which I was wondering whether fselect might fulfill.

Specifically we need to see if each *.md file in the source directory (e.g. content) has generated one or more files in the destination directory (e.g. public). Would fselect be able to "diff" the entries in the public directory and indicate whether something in the content directory appears in the same path in the public directory?

Something like below would be ideal but since the documentation says fselect is not real SQL I wanted to see if it was possible anyway :-).

SELECT path
  FROM public
 WHERE NOT EXISTS (
       SELECT * FROM content 
       WHERE content.path_parent = public.path_parent AND content.path = CONCAT(public.path_without_extn, '.md')) 
   AND name = '*.html'