feat(oscar): add OSCAR database support

This commit is contained in:
t8y2 committed 2026-06-30 20:07:55 +08:00
1 parent d3272b4750
commit 25dcbeb7e4
33 files changed
+204 -19

No files matched your search

@@ -570,6 +570,7 @@ const driverProfiles: Record<
},
kylin: { type: "kylin", port: 7070, user: "ADMIN", label: "Apache Kylin", icon: "kylin" },
sundb: { type: "sundb", port: 22000, user: "root", label: "SunDB", icon: "sundb" },
oscar: { type: "oscar", port: 2003, user: "SYSDBA", label: "神通 OSCAR", icon: "oscar" },
jdbc: { type: "jdbc", port: 0, user: "", label: "JDBC", icon: "jdbc" },
tdengine: { type: "tdengine", port: 6041, user: "root", label: "TDengine", icon: "tdengine" },
xugu: { type: "xugu", port: 5138, user: "", label: "虚谷 XuguDB", icon: "xugu" },
@@ -1360,6 +1361,7 @@ const iconTypeMap: Record<string, string> = {
bigquery: "bigquery",
kylin: "kylin",
sundb: "sundb",
oscar: "oscar",
influxdb: "influxdb",
jdbc: "jdbc",
custom_mysql: "mysql",
@@ -1426,6 +1428,7 @@ const dbOptions: DbOption[] = [
{ value: "bigquery", label: "BigQuery" },
{ value: "kylin", label: "Kylin" },
{ value: "sundb", label: "SunDB" },
{ value: "oscar", label: "神通 OSCAR" },
{ value: "xugu", label: "虚谷 XuguDB" },
{ value: "iotdb", label: "Apache IoTDB" },
{ value: "etcd", label: "etcd" },
@@ -92,7 +92,9 @@ const assetIcons: Record<string, string> = {
zookeeper: "zookeeper",
};
const letterIcons: Record<string, { letter: string; color: string }> = {};
const letterIcons: Record<string, { letter: string; color: string }> = {
oscar: { letter: "O", color: "#2563eb" },
};
const normalizedType = computed(() => props.dbType.toLowerCase().replace(/[\s-]+/g, "_"));
const assetName = computed(() => assetIcons[normalizedType.value]);
@@ -18,6 +18,10 @@ describe("connectionAttemptTimeout", () => {
expect(connectionAttemptTimeoutMs({ db_type: "prestosql", connect_timeout_secs: 5, transport_layers: [] })).toBe(AGENT_DRIVER_MIN_CONNECT_TIMEOUT_SECS * 1000 + CONNECTION_ATTEMPT_TIMEOUT_BUFFER_MS);
});
it("uses the startup floor for generic JDBC plugin connections", () => {
expect(connectionAttemptTimeoutMs({ db_type: "jdbc", connect_timeout_secs: 5, transport_layers: [] })).toBe(AGENT_DRIVER_MIN_CONNECT_TIMEOUT_SECS * 1000 + CONNECTION_ATTEMPT_TIMEOUT_BUFFER_MS);
});
it("uses the startup floor for ZooKeeper agent connections", () => {
expect(connectionAttemptTimeoutMs({ db_type: "zookeeper", connect_timeout_secs: 5, transport_layers: [] })).toBe(AGENT_DRIVER_MIN_CONNECT_TIMEOUT_SECS * 1000 + CONNECTION_ATTEMPT_TIMEOUT_BUFFER_MS);
});
@@ -27,6 +27,7 @@ const DRIVER_STARTUP_FLOOR_TYPES = new Set<DatabaseType>([
"snowflake",
"trino",
"prestosql",
"jdbc",
"hive",
"db2",
"informix",
@@ -35,6 +36,7 @@ const DRIVER_STARTUP_FLOOR_TYPES = new Set<DatabaseType>([
"bigquery",
"kylin",
"sundb",
"oscar",
"tdengine",
"xugu",
"iotdb",
@@ -142,6 +142,9 @@ export function connectionUrlPlaceholder(dbType: DatabaseType): string {
case "tdengine":
return "tdengine://user:password@host:6041/database";
case "oscar":
return "oscar://user:password@host:2003/database";
case "xugu":
return "xugu://user:password@host:5138/database";
+1
View File
@@ -58,6 +58,7 @@ const SCHEME_PROFILES: Record<string, ConnectionProfile> = {
questdb: { type: "questdb", profile: "questdb", label: "QuestDB", defaultPort: 8812 },
tdengine: { type: "tdengine", profile: "tdengine", label: "TDengine", defaultPort: 6041 },
"taos-ws": { type: "tdengine", profile: "tdengine", label: "TDengine", defaultPort: 6041 },
oscar: { type: "oscar", profile: "oscar", label: "神通 OSCAR", defaultPort: 2003 },
xugu: { type: "xugu", profile: "xugu", label: "XuguDB", defaultPort: 5138 },
iotdb: { type: "iotdb", profile: "iotdb", label: "Apache IoTDB", defaultPort: 6667 },
iris: { type: "iris", profile: "iris", label: "IRIS", defaultPort: 1972 },
@@ -30,6 +30,7 @@ export const SCHEMA_AWARE_TYPES = new Set<DatabaseType>([
"db2",
"informix",
"xugu",
"oscar",
"iotdb",
"iris",
"duckdb",
@@ -64,6 +65,7 @@ export const TREE_SCHEMA_TYPES = new Set<DatabaseType>([
"h2",
"informix",
"xugu",
"oscar",
"iotdb",
"iris",
"duckdb",
@@ -83,6 +83,7 @@ const NAVICAT_STYLE_TABLE_DATA_TYPES = new Set<DatabaseType>([
"informix",
"bigquery",
"sundb",
"oscar",
"databend",
]);
@@ -282,6 +282,7 @@ const capabilityByType: Partial<Record<DatabaseType, TableStructureCapabilities>
starrocks: mysqlCapabilities,
goldendb: mysqlCapabilities,
sundb: mysqlCapabilities,
oscar: unsupportedCapabilities,
databend: mysqlCapabilities,
gbase: gbaseCapabilities,
postgres: postgresCapabilities,
@@ -276,6 +276,7 @@ const DATA_TYPE_OPTION_ALIASES: Partial<Record<DatabaseType, string>> = {
starrocks: "mysql",
goldendb: "mysql",
sundb: "mysql",
oscar: "oracle",
gbase: "mysql",
gaussdb: "postgres",
kwdb: "postgres",
@@ -518,6 +518,7 @@ export const useConnectionStore = defineStore("connection", () => {
bigquery: "BigQuery",
kylin: "Kylin",
sundb: "SunDB",
oscar: "神通 OSCAR",
influxdb: "InfluxDB",
};
+1
View File
@@ -51,6 +51,7 @@ export type DatabaseType =
| "bigquery"
| "kylin"
| "sundb"
| "oscar"
| "tdengine"
| "xugu"
| "iotdb"