feat(desktop): improve sql file preview

This commit is contained in:
t8y2 committed 2026-05-30 11:22:17 +08:00
1 parent 99ebecf473
commit 41e23cccc3
6 files changed
+39 -9

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@ pub async fn preview_sql_file(file_path: String) -> Result<SqlFilePreview, Strin
let path = PathBuf::from(&file_path);
let metadata = tokio::fs::metadata(&path).await.map_err(|e| e.to_string())?;
let bytes = tokio::fs::read(&path).await.map_err(|e| e.to_string())?;
let preview = decode_sql_file_bytes(&bytes)?.chars().take(5000).collect();
let preview = decode_sql_file_bytes(&bytes)?.chars().take(20_000).collect();
Ok(SqlFilePreview {
file_name: path.file_name().and_then(|name| name.to_str()).unwrap_or("script.sql").to_string(),