(&self, path: &str, offset: ParseOffset)
| 3905 | } |
| 3906 | |
| 3907 | async fn set_parse_offset_in_existing_tx(&self, path: &str, offset: ParseOffset) -> bool { |
| 3908 | if self |
| 3909 | .conn |
| 3910 | .execute( |
| 3911 | "INSERT INTO parse_offsets (file_path, byte_offset, mtime, file_id) |
| 3912 | VALUES (?1, ?2, ?3, ?4) |
| 3913 | ON CONFLICT(file_path) DO UPDATE SET |
| 3914 | byte_offset = ?2, |
| 3915 | mtime = ?3, |
| 3916 | file_id = ?4", |
| 3917 | params![ |
| 3918 | path, |
| 3919 | offset.byte_offset as i64, |
| 3920 | offset.mtime as i64, |
| 3921 | offset.file_id as i64 |
| 3922 | ], |
| 3923 | ) |
| 3924 | .await |
| 3925 | .is_ok() |
| 3926 | { |
| 3927 | return true; |
| 3928 | } |
| 3929 | self.conn |
| 3930 | .execute( |
| 3931 | "INSERT INTO parse_offsets (file_path, byte_offset, mtime) |
| 3932 | VALUES (?1, ?2, ?3) |
| 3933 | ON CONFLICT(file_path) DO UPDATE SET |
| 3934 | byte_offset = ?2, |
| 3935 | mtime = ?3", |
| 3936 | params![path, offset.byte_offset as i64, offset.mtime as i64], |
| 3937 | ) |
| 3938 | .await |
| 3939 | .is_ok() |
| 3940 | } |
| 3941 | |
| 3942 | /// Checkpoints the WAL. Best-effort. |
| 3943 | pub async fn checkpoint(&self) { |
no test coverage detected