25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
import type { ObjectBrowserRow } from "@/lib/table/objectBrowserRows";
export function objectBrowserTableSelectionAnchor(rows: readonly ObjectBrowserRow[], anchorId: string | null, currentId: string): string {
if (anchorId && rows.some((row) => row.id === anchorId)) return anchorId;
return currentId;
}
/**
* Compute the contiguous object-id range for a shift-click in the object
* browser, mirroring the sidebar tree's range-select behavior:
* the range spans every row between the anchor and the clicked row
* in visible order.
*/
export function objectBrowserTableSelectionRange(rows: readonly ObjectBrowserRow[], anchorId: string, currentId: string): string[] {
const anchorIndex = rows.findIndex((row) => row.id === anchorId);
const currentIndex = rows.findIndex((row) => row.id === currentId);
if (anchorIndex < 0 || currentIndex < 0) return rows.some((row) => row.id === currentId) ? [currentId] : [];
const start = Math.min(anchorIndex, currentIndex);
const end = Math.max(anchorIndex, currentIndex);
return rows.slice(start, end + 1).map((row) => row.id);
}