Trying to edit photo paths using Sqlite3

I changed several folder names where I store my photos, and now I’m trying to edit the photo paths using Sqlite 3. I’m using Windows 11, but I’ve been following the instructions here.

When I get to “select path from photos order by path limit 10;” I get the following error message: “Parse error: no such table: photos.” Am I doing something wrong? Or does this process work differently in Windows? Thanks!

Screenshot 2022-04-02 083112


I believe you have to use forward slashes in the path and set the path in quotes as there is a whitespace in it: .open "g:/my drive/research/draft/draft.tpy".

You got the error message because you didn’t actually open an existing database (see the explanation here).

This is helpful, thank you! I can now print the list of all the photos in the project.

But I’m still doing something wrong. I tried to update the paths like this:

update photos set path = replace(path, ‘/Library of Congress 2019/’, ‘/Library of Congress/’);

But when I printed the paths again that one hadn’t changed. What should I try now? Do I need a longer path in the update command?

Here again you have to use backslashes on Windows. :wink:

update photos set path = replace(path, '\Library of Congress 2019\', '\Library of Congress\');

That worked. Thank you so much!