-- @query folder_resolve_by_fsid
-- @db localContent 32.0
-- @param fsid TEXT
SELECT im.LocalID AS localId
FROM localContent.ItemMetadata AS im
WHERE lower(hex(im.FileSystemID)) = ?fsid
  AND im.ItemType = 2
  AND im.Tombstoned = 0
LIMIT 1
