-- @query import_enumeration_counts
-- @db importDrive 1.0
-- @param enumeration_id TEXT
-- @param last_import_time INT
SELECT
    COUNT(*) as AllCount,
    SUM(CASE WHEN ModTime > ?last_import_time THEN 1 ELSE 0 END) as NewCount
FROM importDrive.EnumerationContents
WHERE EnumerationID = ?enumeration_id
  AND IsDirectory = 0
