Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Only use these steps for an app whose source you trust. Homebrew installations u
14. Automatic project entry-point detection with one-click run support for Spring Boot, Java, Maven, Gradle, npm, Cargo, Go, Python, Make, Docker Compose, Procfile, and shell projects.
15. Per-language service switches so language servers can be enabled or disabled independently to match the machine's resources.
16. Multi-line editor tabs for keeping more files visible in the same workspace.
17. Database connection workspace with multiple database types, connection management, SQL history, table browsing, and database operations.
17. Database connection workspace (currently macOS only) with multiple database types, connection management, SQL history, table browsing, and database operations.
18. Ongoing bug fixes and user experience improvements.

</details>
Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Lithe 是一款主要面向 Java 和 Spring Boot 开发者的轻量级 IDEA 替
14. 自动识别 Spring Boot、Java、Maven、Gradle、npm、Cargo、Go、Python、Make、Docker Compose、Procfile 和 Shell 项目的可运行入口,并支持一键运行。
15. 支持按语言独立开关语言服务,可根据电脑配置自由启用或停用。
16. 支持类似 IDEA 的多行编辑器标签,同时展示更多打开的文件。
17. 新增数据库连接工作台,支持多种数据库类型、连接管理、SQL 历史、表浏览和数据库操作。
17. 新增数据库连接工作台(目前仅支持 macOS),支持多种数据库类型、连接管理、SQL 历史、表浏览和数据库操作。
18. 持续修复问题并优化用户体验。

</details>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
},
"windows": {
"evidence": [
"windows/tauri/src/features/database"
"windows/tauri/src/config/backend-capabilities.ts"
],
"implementationStatus": "implemented",
"verificationStatus": "pending"
"implementationStatus": "missing",
"verificationStatus": "not-applicable"
},
"owner": "Database",
"verification": "验证新增、编辑、删除、事务失败、复制和结果导出。 macOS 中文界面使用同时包含 Name、名称、Type 列的表,检查筛选、排序、批量更新和替换的列名保持原样;替换的 All columns 固定选项保留本地化,选择列后只修改对应列。 macOS 未选表/未选连接时,数据区使用共享 StatusText 操作提示,无大图标或重复标题;结构页同样使用共享提示,检查深浅主题。"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
},
"windows": {
"evidence": [
"windows/tauri/src/features/database"
"windows/tauri/src/config/backend-capabilities.ts"
],
"implementationStatus": "implemented",
"verificationStatus": "pending"
"implementationStatus": "missing",
"verificationStatus": "not-applicable"
},
"owner": "Database",
"verification": "执行查询、取消查询、查看 SQL 历史和分页结果,确认长结果不阻塞界面。"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
},
"windows": {
"evidence": [
"windows/tauri/src/features/database"
"windows/tauri/src/config/backend-capabilities.ts"
],
"implementationStatus": "implemented",
"verificationStatus": "pending"
"implementationStatus": "missing",
"verificationStatus": "not-applicable"
},
"owner": "Database",
"verification": "展开数据库、Schema、表和列,验证刷新、筛选和空结果展示。"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { isBackendCapabilityAvailable } from "@/config/backend-capabilities";
import type { DatabaseType } from "@/features/database/types/provider.types";
import { getLanguageIdFromPath } from "@/features/editor/utils/language-id";
import { getBaseName } from "@/utils/path-helpers";
Expand All @@ -21,9 +22,13 @@ const isDuckDBFile = (path: string): boolean => {
};

/**
* Get the database type from a file path, or null if not a database file
* Get the database viewer type for a file path, or null when the file should
* open through the generic text/binary path. The viewer needs the database
* backend; while that capability is unavailable, `.db` and similar files are
* not routed into a viewer whose every request is rejected.
*/
export const getDatabaseTypeFromPath = (path: string): DatabaseType | null => {
if (!isBackendCapabilityAvailable("database")) return null;
if (isSQLiteFile(path)) return "sqlite";
if (isDuckDBFile(path)) return "duckdb";
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,18 @@ describe("shared open and restore content routing", () => {
expect(await loadFileContent("app.java")).toEqual({ kind: "binary" });
});

test("database files use the generic path while the database backend is unavailable", async () => {
classifyText.mockResolvedValue({ isPlainText: false });
readFileContent.mockResolvedValue("SQLite format 3\0");
for (const path of ["cache.db", "app.sqlite", "app.sqlite3", "warehouse.duckdb"]) {
expect(await loadFileContent(path)).toEqual({ kind: "binary" });
}

classifyText.mockResolvedValue({ isPlainText: true });
readFileContent.mockResolvedValue("key=value\n");
expect(await loadFileContent("settings.db")).toMatchObject({ kind: "text", content: "key=value\n" });
});

test("read errors are not disguised as binary files", async () => {
readFileContent.mockRejectedValue(new Error("permission denied"));
await expect(loadFileContent("app.properties")).rejects.toThrow("permission denied");
Expand Down
Loading