Fix memory-docs line-count SQL edge case, remove stale tmp-referencing test
Nightly Build / build (push) Successful in 6m46s
Nightly Build / build (push) Successful in 6m46s
- memory_docs list_with_metadata: use SQL substr to detect trailing newline instead of counting newlines and adding 1 unconditionally - list_files: remove meta_smoke tests that referenced a non-existent scratchpad directory
This commit is contained in:
@@ -102,7 +102,8 @@ pub async fn list_with_metadata(pool: &SqlitePool, prefix: &str) -> Result<Vec<M
|
||||
let rows = sqlx::query_as::<_, MemoryEntryMeta>(
|
||||
"SELECT path,
|
||||
CASE WHEN content = '' THEN 0
|
||||
ELSE LENGTH(content) - LENGTH(REPLACE(content, char(10), '')) + 1
|
||||
ELSE LENGTH(content) - LENGTH(REPLACE(content, char(10), ''))
|
||||
+ CASE WHEN substr(content, -1, 1) = char(10) THEN 0 ELSE 1 END
|
||||
END AS line_count,
|
||||
LENGTH(CAST(content AS BLOB)) AS byte_len
|
||||
FROM memory_docs
|
||||
|
||||
Reference in New Issue
Block a user