From ce81898a0716b194f0fb403be56e6cfda997239e Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sun, 11 Jul 2021 22:32:03 +1000 Subject: [PATCH] another useful sql for finding usable list of filenames that equate to a search --- README | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README b/README index e4c4480..a4acbfe 100644 --- a/README +++ b/README @@ -108,3 +108,8 @@ sudo docker exec -it padb bash sudo docker exec -it padb bash psql --user=pa pa select count(distinct e.id) from entry e, entry_dir_link edl where e.type_id = 1 and e.id = edl.entry_id and edl.dir_eid in ( select distinct dir_eid from path_dir_link where path_id = 2 ); + + +# get abs filenames of matching files (for liz person.tag, but could easily add +# d.rel_path like 'liz' too : +select '"'||replace(replace(p.path_prefix,'static/Storage/',''),'static/Import/', '')||'/'||d.rel_path||'/'||e.name||'"' from entry e, entry_dir_link edl, path_dir_link pdl, path p, dir d where e.id = edl.entry_id and edl.dir_eid = pdl.dir_eid and pdl.path_id = p.id and d.eid = edl.dir_eid and e.id in ( select e.id from entry e, face_file_link ffl, face_refimg_link frl, person_refimg_link prl, person p where e.id = ffl.file_eid and ffl.face_id = frl.face_id and frl.refimg_id = prl.refimg_id and prl.person_id = p.id and p.tag = 'liz' );