read_files.sql

 1-- name: RecordFileRead :exec
 2INSERT INTO read_files (
 3    session_id,
 4    path,
 5    read_at
 6) VALUES (
 7    ?,
 8    ?,
 9    strftime('%s', 'now')
10) ON CONFLICT(path, session_id) DO UPDATE SET
11    read_at = excluded.read_at;
12
13-- name: GetFileRead :one
14SELECT * FROM read_files
15WHERE session_id = ? AND path = ? LIMIT 1;