read_files.sql 317 B

123456789101112131415
  1. -- name: RecordFileRead :exec
  2. INSERT 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. -- name: GetFileRead :one
  13. SELECT * FROM read_files
  14. WHERE session_id = ? AND path = ? LIMIT 1;