Skip to content

armgit / dbx

Public Imported from GitHub
0

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。

feat: add Microsoft Access database support

t8y21bcfd02de105
diff --git a/crates/dbx-core/src/connection.rs b/crates/dbx-core/src/connection.rs
index 11f2f9e60a..b47c4272f5 100644
--- a/crates/dbx-core/src/connection.rs
+++ b/crates/dbx-core/src/connection.rs
@@ -239,6 +239,7 @@ impl AppState {
| DatabaseType::Kylin
| DatabaseType::Sundb
| DatabaseType::Tdengine
+ | DatabaseType::Access
| DatabaseType::Gaussdb => {
let mut client =
self.agent_manager.spawn(&db_config.db_type, db_config.driver_profile.as_deref()).await?;
@@ -437,6 +438,7 @@ pub fn agent_connect_params(config: &ConnectionConfig, host: &str, port: u16, da
"username": config.username,
"password": config.password,
"url_params": config.url_params.as_deref().unwrap_or(""),
+ "connection_string": config.connection_string.as_deref().unwrap_or(""),
})
}
diff --git a/crates/dbx-core/src/database_capabilities.rs b/crates/dbx-core/src/database_capabilities.rs
index 49a9c8ea72..bdca405177 100644
--- a/crates/dbx-core/src/database_capabilities.rs
+++ b/crates/dbx-core/src/database_capabilities.rs
@@ -25,6 +25,7 @@ pub fn agent_key(db_type: &DatabaseType, driver_profile: Option<&str>) -> Option
DatabaseType::Gaussdb => Some("gaussdb"),
DatabaseType::MongoDb => Some("mongodb"),
DatabaseType::Tdengine => Some("tdengine"),
+ DatabaseType::Access => Some("access"),
_ => None,
}
}
@@ -44,6 +45,7 @@ pub fn is_single_connection_pool(db_type: &DatabaseType) -> bool {
| DatabaseType::Highgo
| DatabaseType::Vastbase
| DatabaseType::Goldendb
+ | DatabaseType::Access
| DatabaseType::Jdbc
)
}
diff --git a/crates/dbx-core/src/models/connection.rs b/crates/dbx-core/src/models/connection.rs
index e78482aeb7..112e881d49 100644
--- a/crates/dbx-core/src/models/connection.rs
+++ b/crates/dbx-core/src/models/connection.rs
@@ -120,6 +120,7 @@ pub enum DatabaseType {
Vastbase,
Goldendb,
Gaussdb,
+ Access,
#[serde(rename = "h2")]
H2,
Snowflake,
@@ -213,6 +214,7 @@ impl ConnectionConfig {
DatabaseType::Sqlite | DatabaseType::DuckDb => {
format!("{}?mode=rwc", self.host)
}
+ DatabaseType::Access => self.host.clone(),
DatabaseType::Redis => {
let scheme = if self.ssl { "rediss" } else { "redis" };
format!("{scheme}://{host}:{port}/")
@@ -284,6 +286,7 @@ impl ConnectionConfig {
DatabaseType::Sqlite | DatabaseType::DuckDb => {
format!("{}?mode=rwc", self.host)
}
+ DatabaseType::Access => self.host.clone(),
DatabaseType::Redis => {
let scheme = if self.ssl { "rediss" } else { "redis" };
if self.username.is_empty() && self.password.is_empty() {
diff --git a/crates/dbx-core/tests/database_capabilities.rs b/crates/dbx-core/tests/database_capabilities.rs
index 1d1ffbb969..4337f3b12d 100644
--- a/crates/dbx-core/tests/database_capabilities.rs
+++ b/crates/dbx-core/tests/database_capabilities.rs
@@ -9,6 +9,7 @@ fn maps_agent_database_types_to_driver_keys() {
assert_eq!(agent_key(&DatabaseType::Hive, None), Some("hive"));
assert_eq!(agent_key(&DatabaseType::Gaussdb, None), Some("gaussdb"));
assert_eq!(agent_key(&DatabaseType::Tdengine, None), Some("tdengine"));
+ assert_eq!(agent_key(&DatabaseType::Access, None), Some("access"));
assert_eq!(agent_key(&DatabaseType::Oracle, None), Some("oracle"));
assert_eq!(agent_key(&DatabaseType::Oracle, Some("oracle-10g")), Some("oracle-10g"));
assert_eq!(agent_key(&DatabaseType::Postgres, None), None);
@@ -20,6 +21,7 @@ fn classifies_agent_database_types() {
assert!(is_agent_type(&DatabaseType::Trino));
assert!(is_agent_type(&DatabaseType::Hive));
assert!(is_agent_type(&DatabaseType::Tdengine));
+ assert!(is_agent_type(&DatabaseType::Access));
assert!(!is_agent_type(&DatabaseType::Mysql));
assert!(!is_agent_type(&DatabaseType::Jdbc));
}
@@ -30,6 +32,7 @@ fn identifies_single_connection_pool_types() {
assert!(is_single_connection_pool(&DatabaseType::DuckDb));
assert!(is_single_connection_pool(&DatabaseType::Oracle));
assert!(is_single_connection_pool(&DatabaseType::Dameng));
+ assert!(is_single_connection_pool(&DatabaseType::Access));
assert!(is_single_connection_pool(&DatabaseType::Jdbc));
assert!(!is_single_connection_pool(&DatabaseType::Trino));
assert!(!is_single_connection_pool(&DatabaseType::Postgres));
@@ -49,6 +52,7 @@ fn skips_tcp_probe_for_local_file_plugin_and_agent_types() {
assert!(skips_tcp_probe(&DatabaseType::Sqlite));
assert!(skips_tcp_probe(&DatabaseType::DuckDb));
assert!(skips_tcp_probe(&DatabaseType::Jdbc));
+ assert!(skips_tcp_probe(&DatabaseType::Access));
assert!(skips_tcp_probe(&DatabaseType::Trino));
assert!(skips_tcp_probe(&DatabaseType::Oracle));
assert!(skips_tcp_probe(&DatabaseType::Tdengine));
diff --git a/public/icons/database/access.png b/public/icons/database/access.png
new file mode 100644
index 0000000000..44138a10e7
Binary files /dev/null and b/public/icons/database/access.png differ
diff --git a/public/icons/database/goldendb.png b/public/icons/database/goldendb.png
new file mode 100644
index 0000000000..b635a723b1
Binary files /dev/null and b/public/icons/database/goldendb.png differ
diff --git a/public/icons/database/vastbase.png b/public/icons/database/vastbase.png
new file mode 100644
index 0000000000..1007b05fa6
Binary files /dev/null and b/public/icons/database/vastbase.png differ
diff --git a/src-tauri/src/commands/agents.rs b/src-tauri/src/commands/agents.rs
index 2dfaef8534..00cc5cd338 100644
--- a/src-tauri/src/commands/agents.rs
+++ b/src-tauri/src/commands/agents.rs
@@ -21,6 +21,7 @@ const AGENT_TYPES: &[(&str, &str)] = &[
("highgo", "瀚高 HighGo"),
("vastbase", "Vastbase"),
("goldendb", "GoldenDB"),
+ ("access", "Microsoft Access"),
("oracle", "Oracle"),
("oracle-10g", "Oracle 10g"),
("h2", "H2"),
@@ -104,13 +105,14 @@ mod tests {
use dbx_core::agent_manager::AgentManager;
#[test]
- fn built_in_agent_list_includes_tdengine() {
+ fn built_in_agent_list_includes_access_and_tdengine() {
let dir = std::env::temp_dir().join(format!("dbx-agent-list-test-{}", uuid::Uuid::new_v4()));
let manager = AgentManager::new_with_base_dir(dir.clone());
let agents = build_agent_list(&manager, None);
assert!(agents.iter().any(|agent| agent.db_type == "tdengine" && agent.label == "TDengine"));
+ assert!(agents.iter().any(|agent| agent.db_type == "access" && agent.label == "Microsoft Access"));
let _ = std::fs::remove_dir_all(dir);
}
diff --git a/src/components/connection/ConnectionDialog.vue b/src/components/connection/ConnectionDialog.vue
index 59f555b6d0..2c30a2aa35 100644
--- a/src/components/connection/ConnectionDialog.vue
+++ b/src/components/connection/ConnectionDialog.vue
@@ -130,6 +130,7 @@ const driverProfiles: Record<
redis: { type: "redis", port: 6379, user: "", label: "Redis", icon: "redis" },
sqlite: { type: "sqlite", port: 0, user: "", label: "SQLite", icon: "sqlite" },
duckdb: { type: "duckdb", port: 0, user: "", label: "DuckDB", icon: "duckdb" },
+ access: { type: "access", port: 0, user: "", label: "Microsoft Access", icon: "access" },
mongodb: { type: "mongodb", port: 27017, user: "", label: "MongoDB", icon: "mongodb" },
clickhouse: {
type: "clickhouse",
@@ -248,7 +249,7 @@ function applyProfile(val: string, preserveConnectionFields = false) {
form.value.port = profile.port;
form.value.username = profile.user;
form.value.url_params = profile.urlParams || "";
- if (profile.type === "sqlite" || profile.type === "duckdb") {
+ if (profile.type === "sqlite" || profile.type === "duckdb" || profile.type === "access") {
form.value.host = "";
}
if (profile.type === "jdbc") {
@@ -358,6 +359,7 @@ const iconTypeMap: Record<string, string> = {
mysql: "mysql",
postgres: "postgres",
sqlite: "sqlite",
+ access: "access",
redis: "redis",
mongodb: "mongodb",
duckdb: "duckdb",
@@ -402,6 +404,7 @@ const dbOptions = [
{ value: "mysql", label: "MySQL" },
{ value: "postgres", label: "PostgreSQL" },
{ value: "sqlite", label: "SQLite" },
+ { value: "access", label: "Microsoft Access" },
{ value: "redis", label: "Redis" },
{ value: "mongodb", label: "MongoDB" },
{ value: "duckdb", label: "DuckDB" },
@@ -467,8 +470,15 @@ const selectedDbIcon = computed(() => iconTypeMap[selectedType.value] || selecte
const isJdbcConnection = computed(() => form.value.db_type === "jdbc");
const connectionUrlPlaceholder = computed(() => getUrlPlaceholder(form.value.db_type));
-const canUseSsh = computed(() => form.value.db_type !== "sqlite");
-const canUseProxy = computed(() => form.value.db_type !== "sqlite" && form.value.db_type !== "duckdb");
+const filePathPlaceholder = computed(() => {
+ if (form.value.db_type === "duckdb") return "/path/to/database.duckdb";
+ if (form.value.db_type === "access") return "/path/to/database.accdb";
+ return "/path/to/database.db";
+});
+const canUseSsh = computed(() => form.value.db_type !== "sqlite" && form.value.db_type !== "access");
+const canUseProxy = computed(
+ () => form.value.db_type !== "sqlite" && form.value.db_type !== "duckdb" && form.value.db_type !== "access",
+);
const shouldShowAgentDriverInstallHint = computed(() =>
showAgentDriverInstallHint(form.value.db_type, agentDrivers.value),
);
@@ -677,7 +687,9 @@ async function browseDbFilePath() {
const filters =
form.value.db_type === "duckdb"
? [{ name: "DuckDB", extensions: ["duckdb", "db"] }]
- : [{ name: "SQLite", extensions: ["db", "sqlite", "sqlite3"] }];
+ : form.value.db_type === "access"
+ ? [{ name: "Microsoft Access", extensions: ["accdb", "mdb"] }]
+ : [{ name: "SQLite", extensions: ["db", "sqlite", "sqlite3"] }];
const selected = await open({
title: "Select Database File",
multiple: false,
@@ -1040,12 +1052,14 @@ function openExternalUrl(url: string) {
</div>
</template>
- <!-- SQLite / DuckDB: file path only -->
- <template v-else-if="form.db_type === 'sqlite' || form.db_type === 'duckdb'">
+ <!-- Local database files: file path only -->
+ <template
+ v-else-if="form.db_type === 'sqlite' || form.db_type === 'duckdb' || form.db_type === 'access'"
+ >
<div class="grid grid-cols-4 items-center gap-4">
<Label class="text-right">{{ t("connection.filePath") }}</Label>
<div class="col-span-3 flex items-center gap-1">
- <Input v-model="form.host" class="flex-1" placeholder="/path/to/database.db" />
+ <Input v-model="form.host" class="flex-1" :placeholder="filePathPlaceholder" />
<Tooltip v-if="isDesktop">
<TooltipTrigger as-child>
<Button variant="outline" size="icon" class="h-9 w-9 shrink-0" @click="browseDbFilePath">
diff --git a/src/components/icons/DatabaseIcon.vue b/src/components/icons/DatabaseIcon.vue
index 22bf4cd0bc..d56e59b28e 100644
--- a/src/components/icons/DatabaseIcon.vue
+++ b/src/components/icons/DatabaseIcon.vue
@@ -22,10 +22,13 @@ const assetIcons: Record<string, string> = {
"oracle-10g": "oracle",
oracle_10g: "oracle",
sqlserver: "sqlserver",
+ access: "access.png",
oceanbase: "oceanbase",
opengauss: "opengauss",
gaussdb: "gaussdb",
kingbase: "kingbase",
+ goldendb: "goldendb.png",
+ vastbase: "vastbase.png",
snowflake: "snowflake",
h2: "h2",
dm: "dm",
@@ -50,24 +53,22 @@ const assetIcons: Record<string, string> = {
};
const letterIcons: Record<string, { letter: string; color: string }> = {
- goldendb: { letter: "G", color: "#F59E0B" },
- vastbase: { letter: "V", color: "#6D28D9" },
highgo: { letter: "瀚", color: "#005bac" },
};
const normalizedType = computed(() => props.dbType.toLowerCase().replace(/[\s-]+/g, "_"));
const assetName = computed(() => assetIcons[normalizedType.value]);
+const assetSrc = computed(() => {
+ if (!assetName.value) return "";
+ return assetName.value.includes(".")
+ ? `/icons/database/${assetName.value}`
+ : `/icons/database/${assetName.value}.svg`;
+});
const letter = computed(() => letterIcons[normalizedType.value]);
</script>
<template>
- <img
- v-if="assetName"
- :src="`/icons/database/${assetName}.svg`"
- alt=""
- class="database-logo object-contain"
- aria-hidden="true"
- />
+ <img v-if="assetName" :src="assetSrc" alt="" class="database-logo object-contain" aria-hidden="true" />
<svg v-else-if="letter" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="12" :fill="letter.color" />
<text
diff --git a/src/lib/connectionPresentation.ts b/src/lib/connectionPresentation.ts
index e7e2e43412..094a2246d0 100644
--- a/src/lib/connectionPresentation.ts
+++ b/src/lib/connectionPresentation.ts
@@ -5,7 +5,7 @@ type ConnectionPresentationConfig = Pick<
"db_type" | "driver_profile" | "driver_label" | "host" | "port" | "database"
>;
-const LOCAL_DATABASE_TYPES = new Set(["sqlite", "duckdb"]);
+const LOCAL_DATABASE_TYPES = new Set(["sqlite", "duckdb", "access"]);
export function connectionIconType(connection?: Pick<ConnectionConfig, "db_type" | "driver_profile">): string {
return connection?.driver_profile || connection?.db_type || "postgres";
@@ -45,6 +45,9 @@ export function connectionUrlPlaceholder(dbType: DatabaseType): string {
case "duckdb":
return "duckdb:///absolute/path/to/database.duckdb";
+ case "access":
+ return "jdbc:ucanaccess:///absolute/path/to/database.accdb";
+
case "mongodb":
return "mongodb://user:password@host:port/database";
diff --git a/src/lib/connectionUrl.ts b/src/lib/connectionUrl.ts
index c81a97cfcb..a53150568d 100644
--- a/src/lib/connectionUrl.ts
+++ b/src/lib/connectionUrl.ts
@@ -107,11 +107,36 @@ function parseJdbcSqlServerUrl(source: string): ParsedConnectionUrl | null {
};
}
+function parseJdbcUCanAccessUrl(source: string): ParsedConnectionUrl | null {
+ const match = source.match(/^jdbc:ucanaccess:\/\/(.+?)(?:;.*)?$/i);
+ if (!match) return null;
+
+ const filePath = decodeUrlPart(match[1]);
+ const normalizedPath = filePath.startsWith("/") || /^[A-Za-z]:[\\/]/.test(filePath) ? filePath : `/${filePath}`;
+ const database = normalizedPath.split(/[\\/]/).filter(Boolean).pop();
+
+ return {
+ dbType: "access",
+ driverProfile: "access",
+ driverLabel: "Microsoft Access",
+ host: normalizedPath,
+ port: 0,
+ username: "",
+ password: "",
+ database,
+ urlParams: "",
+ ssl: false,
+ connectionString: source,
+ };
+}
+
export function parseConnectionUrl(value: string, preferredProfile?: string): ParsedConnectionUrl {
const input = value.trim();
if (!input) {
throw new Error("Connection URL is empty");
}
+ const jdbcUCanAccess = parseJdbcUCanAccessUrl(input);
+ if (jdbcUCanAccess) return jdbcUCanAccess;
const jdbcSqlServer = parseJdbcSqlServerUrl(input);
if (jdbcSqlServer) return jdbcSqlServer;
const source = input.replace(/^jdbc:/i, "");
diff --git a/src/lib/dataGridSql.ts b/src/lib/dataGridSql.ts
index 84b8ed0dba..b8568f4679 100644
--- a/src/lib/dataGridSql.ts
+++ b/src/lib/dataGridSql.ts
@@ -362,7 +362,8 @@ function buildPrimaryKeyWhere(
columns: Array<string | undefined>,
row: GridCellValue[],
): string {
- if (databaseType === "hive" && primaryKeys.length === 0) return buildRowWhere(databaseType, columns, row);
+ if ((databaseType === "hive" || databaseType === "access") && primaryKeys.length === 0)
+ return buildRowWhere(databaseType, columns, row);
return primaryKeys
.map((primaryKey) => {
const value = row[columns.indexOf(primaryKey)];
diff --git a/src/lib/databaseCapabilitySets.ts b/src/lib/databaseCapabilitySets.ts
index 1949a2c87e..fea45cc9e4 100644
--- a/src/lib/databaseCapabilitySets.ts
+++ b/src/lib/databaseCapabilitySets.ts
@@ -33,6 +33,7 @@ export const DIAGRAM_SUPPORTED_TYPES = new Set<DatabaseType>([
"highgo",
"vastbase",
"goldendb",
+ "access",
"h2",
"db2",
]);
@@ -52,6 +53,7 @@ export const DATABASE_SEARCH_SUPPORTED_TYPES = new Set<DatabaseType>([
"highgo",
"vastbase",
"goldendb",
+ "access",
"h2",
"snowflake",
"trino",
@@ -83,6 +85,7 @@ export const TABLE_IMPORT_SUPPORTED_TYPES = new Set<DatabaseType>([
"highgo",
"vastbase",
"goldendb",
+ "access",
]);
export const TABLE_STRUCTURE_SUPPORTED_TYPES = new Set<DatabaseType>(["mysql", "postgres", "sqlite", "sqlserver"]);
@@ -111,7 +114,7 @@ export const FIELD_LINEAGE_SUPPORTED_TYPES = new Set<DatabaseType>([
"gaussdb",
]);
-export const SINGLE_DATABASE_TYPES = new Set<DatabaseType>(["oracle", "dameng"]);
+export const SINGLE_DATABASE_TYPES = new Set<DatabaseType>(["oracle", "dameng", "access"]);
export const FETCH_FIRST_TYPES = new Set<DatabaseType>(["oracle", "dameng"]);
@@ -137,6 +140,7 @@ export const AGENT_DRIVER_TYPES = new Set<DatabaseType>([
"highgo",
"vastbase",
"goldendb",
+ "access",
"oracle",
"h2",
"snowflake",
diff --git a/src/lib/databaseTableDataCapabilities.ts b/src/lib/databaseTableDataCapabilities.ts
index f7e44c014b..2569b67b5e 100644
--- a/src/lib/databaseTableDataCapabilities.ts
+++ b/src/lib/databaseTableDataCapabilities.ts
@@ -35,6 +35,15 @@ const DEFAULT_CAPABILITY: DatabaseCapability = {
};
const DATABASE_CAPABILITY_OVERRIDES: Partial<Record<DatabaseType, Partial<DatabaseCapability>>> = {
+ access: {
+ tableData: {
+ insert: true,
+ updateRequiresPrimaryKey: false,
+ deleteRequiresPrimaryKey: false,
+ requiresTransactionalTableForExistingRows: false,
+ transaction: true,
+ },
+ },
hive: {
tableData: {
insert: true,
diff --git a/src/lib/tableSelectSql.ts b/src/lib/tableSelectSql.ts
index d4209a07a9..96046b4031 100644
--- a/src/lib/tableSelectSql.ts
+++ b/src/lib/tableSelectSql.ts
@@ -17,7 +17,7 @@ export interface BuildTableSelectSqlOptions {
}
export function quoteTableIdentifier(databaseType: DatabaseType | undefined, name: string): string {
- if (databaseType === "mysql" || databaseType === "hive" || databaseType === "tdengine")
+ if (databaseType === "mysql" || databaseType === "hive" || databaseType === "tdengine" || databaseType === "access")
return `\`${name.replace(/`/g, "``")}\``;
if (databaseType === "informix" && /^[A-Za-z_][A-Za-z0-9_$]*$/.test(name)) return name;
if (databaseType === "neo4j") return quoteCypherIdentifier(name);
diff --git a/src/stores/connectionStore.ts b/src/stores/connectionStore.ts
index 30d75ee177..b998efdd95 100644
--- a/src/stores/connectionStore.ts
+++ b/src/stores/connectionStore.ts
@@ -186,6 +186,7 @@ export const useConnectionStore = defineStore("connection", () => {
highgo: "瀚高 HighGo",
vastbase: "Vastbase",
goldendb: "GoldenDB",
+ access: "Microsoft Access",
h2: "H2",
snowflake: "Snowflake",
trino: "Trino",
diff --git a/src/types/database.ts b/src/types/database.ts
index 2117b15eec..fe3fda9c8d 100644
--- a/src/types/database.ts
+++ b/src/types/database.ts
@@ -18,6 +18,7 @@ export type DatabaseType =
| "highgo"
| "vastbase"
| "goldendb"
+ | "access"
| "h2"
| "snowflake"
| "trino"
diff --git a/tests/agentDriverInstallHint.test.ts b/tests/agentDriverInstallHint.test.ts
index 3b43997d52..2ab7fdb729 100644
--- a/tests/agentDriverInstallHint.test.ts
+++ b/tests/agentDriverInstallHint.test.ts
@@ -14,6 +14,10 @@ test("shows the agent driver install hint for TDengine when missing", () => {
assert.equal(showAgentDriverInstallHint("tdengine", [{ db_type: "tdengine", installed: false }]), true);
});
+test("shows the agent driver install hint for Access when missing", () => {
+ assert.equal(showAgentDriverInstallHint("access", [{ db_type: "access", installed: false }]), true);
+});
+
test("does not show agent driver install hints for built-in database types", () => {
assert.equal(showAgentDriverInstallHint("mysql", [{ db_type: "informix", installed: false }]), false);
});
diff --git a/tests/connectionPresentation.test.ts b/tests/connectionPresentation.test.ts
index 73ec4d0102..27e49576c9 100644
--- a/tests/connectionPresentation.test.ts
+++ b/tests/connectionPresentation.test.ts
@@ -37,4 +37,15 @@ test("uses file path as endpoint for local database connections", () => {
};
assert.equal(connectionOptionSubtitle(sqliteConnection), "SQLite · /tmp/local.db");
+
+ const accessConnection: ConnectionConfig = {
+ ...baseConnection,
+ db_type: "access",
+ driver_profile: "access",
+ driver_label: "Microsoft Access",
+ host: "/tmp/Northwind.accdb",
+ port: 0,
+ };
+
+ assert.equal(connectionOptionSubtitle(accessConnection), "Microsoft Access · /tmp/Northwind.accdb");
});
diff --git a/tests/connectionUrl.test.ts b/tests/connectionUrl.test.ts
index 9572227e0b..355dcf4165 100644
--- a/tests/connectionUrl.test.ts
+++ b/tests/connectionUrl.test.ts
@@ -66,6 +66,18 @@ test("parses TDengine WebSocket JDBC URLs", () => {
assert.equal(parsed.urlParams, "timezone=UTC");
});
+test("parses UCanAccess JDBC URLs as Access database files", () => {
+ const parsed = parseConnectionUrl("jdbc:ucanaccess:///Users/me/data/Northwind.accdb;memory=false");
+
+ assert.equal(parsed.dbType, "access");
+ assert.equal(parsed.driverProfile, "access");
+ assert.equal(parsed.driverLabel, "Microsoft Access");
+ assert.equal(parsed.host, "/Users/me/data/Northwind.accdb");
+ assert.equal(parsed.port, 0);
+ assert.equal(parsed.database, "Northwind.accdb");
+ assert.equal(parsed.connectionString, "jdbc:ucanaccess:///Users/me/data/Northwind.accdb;memory=false");
+});
+
test("parses SQL Server JDBC URLs with semicolon properties", () => {
const parsed = parseConnectionUrl(
"jdbc:sqlserver://sql.example.com:1434;databaseName=erp;user=sa;password=s%40cret;encrypt=true",
diff --git a/tests/connectionUrlPlaceholder.test.ts b/tests/connectionUrlPlaceholder.test.ts
index 5424c8de22..f322b6fc7b 100644
--- a/tests/connectionUrlPlaceholder.test.ts
+++ b/tests/connectionUrlPlaceholder.test.ts
@@ -12,6 +12,7 @@ const expected: Record<string, string> = {
redis: "redis://:password@host:port/0",
sqlite: "sqlite:///absolute/path/to/database.db",
duckdb: "duckdb:///absolute/path/to/database.duckdb",
+ access: "jdbc:ucanaccess:///absolute/path/to/database.accdb",
mongodb: "mongodb://user:password@host:port/database",
clickhouse: "clickhouse://user:password@host:port/database",
sqlserver: "mssql://user:password@host:port/database",
diff --git a/tests/dataGridSql.test.ts b/tests/dataGridSql.test.ts
index fc135fb30a..c888ae5383 100644
--- a/tests/dataGridSql.test.ts
+++ b/tests/dataGridSql.test.ts
@@ -40,6 +40,47 @@ test("builds SQL Server grid save statements with schema and bracket quoting", (
]);
});
+test("builds Access grid save statements with backtick identifiers", () => {
+ const statements = buildDataGridSaveStatements({
+ databaseType: "access",
+ tableMeta: {
+ tableName: "Order Details",
+ primaryKeys: ["Order ID"],
+ },
+ columns: ["Order ID", "Product Name", "Active"],
+ rows: [[42, "Old", true]],
+ dirtyRows: [[0, [[1, "Ready"]]]],
+ deletedRows: [0],
+ newRows: [[43, "New", false]],
+ });
+
+ assert.deepEqual(statements, [
+ "UPDATE `Order Details` SET `Product Name` = 'Ready' WHERE `Order ID` = 42;",
+ "DELETE FROM `Order Details` WHERE `Order ID` = 42;",
+ "INSERT INTO `Order Details` (`Order ID`, `Product Name`, `Active`) VALUES (43, 'New', FALSE);",
+ ]);
+});
+
+test("builds Access grid save statements with row predicates when primary keys are unavailable", () => {
+ const statements = buildDataGridSaveStatements({
+ databaseType: "access",
+ tableMeta: {
+ tableName: "orders",
+ primaryKeys: [],
+ },
+ columns: ["id", "quantity", "status", "shipped_at"],
+ rows: [[1, 3, "pending", null]],
+ dirtyRows: [[0, [[1, 4]]]],
+ deletedRows: [0],
+ newRows: [],
+ });
+
+ assert.deepEqual(statements, [
+ "UPDATE `orders` SET `quantity` = 4 WHERE `id` = 1 AND `quantity` = 3 AND `status` = 'pending' AND `shipped_at` IS NULL;",
+ "DELETE FROM `orders` WHERE `id` = 1 AND `quantity` = 3 AND `status` = 'pending' AND `shipped_at` IS NULL;",
+ ]);
+});
+
test("builds grid save statements through source columns for aliased query results", () => {
const statements = buildDataGridSaveStatements({
databaseType: "postgres",
diff --git a/tests/databaseCapabilities.test.ts b/tests/databaseCapabilities.test.ts
index fea152b058..fe9cd0a7a7 100644
--- a/tests/databaseCapabilities.test.ts
+++ b/tests/databaseCapabilities.test.ts
@@ -29,6 +29,13 @@ test("treats TDengine databases as schema tree roots and agent driver databases"
assert.equal(supportsDriverManagement("tdengine"), true);
});
+test("treats Access as a local single-database agent driver", () => {
+ assert.equal(SCHEMA_AWARE_TYPES.has("access"), false);
+ assert.equal(supportsDriverManagement("access"), true);
+ assert.equal(supportsDatabaseSearch("access"), true);
+ assert.equal(supportsTableImport("access"), true);
+});
+
test("describes schema tree mode through the capability helper", () => {
assert.equal(usesTreeSchemaMode("trino"), true);
assert.equal(usesTreeSchemaMode("h2"), true);
diff --git a/tests/tableEditing.test.ts b/tests/tableEditing.test.ts
index 27ac629791..91e031e09d 100644
--- a/tests/tableEditing.test.ts
+++ b/tests/tableEditing.test.ts
@@ -46,6 +46,7 @@ test("uses tbname and timestamp as TDengine editable keys", () => {
});
test("allows Hive table data editing even without declared primary keys", () => {
+ assert.equal(isTableDataEditable("access", []), true);
assert.equal(isTableDataEditable("hive", []), true);
assert.equal(isTableDataEditable("trino", []), true);
assert.equal(isTableDataEditable("informix", []), true);
@@ -60,7 +61,9 @@ test("does not use transactional grid saves for Hive", () => {
assert.equal(supportsDataGridTransaction("postgres"), true);
});
-test("allows existing row edits for Hive only when the table is transactional", () => {
+test("allows existing row edits according to database-specific key requirements", () => {
+ assert.equal(canEditExistingTableRows("access", undefined, []), true);
+ assert.equal(canEditExistingTableRows("access", undefined, ["ID"]), true);
assert.equal(canEditExistingTableRows("hive", true), true);
assert.equal(canEditExistingTableRows("hive", false), false);
assert.equal(canEditExistingTableRows("hive", undefined), false);
diff --git a/tests/tableSelectSql.test.ts b/tests/tableSelectSql.test.ts
index ce1c2b547b..c7b3a811d3 100644
--- a/tests/tableSelectSql.test.ts
+++ b/tests/tableSelectSql.test.ts
@@ -78,6 +78,18 @@ test("builds Informix table data queries without database-qualified delimited id
assert.equal(sql, "SELECT * FROM dbx_grid_edit_probe ORDER BY id ASC LIMIT 100;");
});
+test("builds Access table data queries with backtick identifiers", () => {
+ const sql = buildTableSelectSql({
+ databaseType: "access",
+ tableName: "Order Details",
+ primaryKeys: ["Order ID"],
+ limit: 100,
+ offset: 200,
+ });
+
+ assert.equal(sql, "SELECT * FROM `Order Details` ORDER BY `Order ID` ASC LIMIT 100 OFFSET 200;");
+});
+
test("expands Hive table data queries into aliased table columns", () => {
const sql = buildTableSelectSql({
databaseType: "hive",