-- @query import_failed_items
-- @db importDrive 1.0
-- @param enumeration_id TEXT
-- @param limit INT
-- @param offset INT
SELECT
    hex(FileSystemID) as itemId,
    FullPath as path,
    Status as status,
    LastUpdateTime as lastUpdateTime
FROM importDrive.EnumerationContents
WHERE EnumerationID = ?enumeration_id
  AND IsDirectory = 0
  AND Status != 1
  AND Status != 3
ORDER BY FullPath
LIMIT ?limit OFFSET ?offset
