feat: add InfluxDB support (#980)
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="154" height="156" viewBox="0 0 154 156" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="m 111.76244,105.55719 33.75203,-7.710196 c 0.51964,-0.104857 1.01231,-0.316521 1.4455,-0.621423 0.43411,-0.304901 0.7985,-0.696439 1.0718,-1.149608 0.27329,-0.453077 0.44899,-0.958023 0.51591,-1.482398 0.066,-0.524375 0.0223,-1.056837 -0.12921,-1.563456 l -14.3536,-62.024578 c -0.25936,-1.023558 -0.91564,-1.902939 -1.82477,-2.445254 -0.90912,-0.542316 -1.99673,-0.703319 -3.02484,-0.447685 l -33.738648,7.709824 c -1.021327,0.261025 -1.897268,0.914332 -2.43633,1.817045 -0.538969,0.902713 -0.697276,1.981302 -0.440062,2.99984 l 14.31261,62.025039 c 0.25936,1.02347 0.91471,1.90285 1.82383,2.44479 0.90913,0.54195 1.99767,0.70369 3.02578,0.44806 z" fill="#d30971" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="m 100.13156,143.8846 40.92187,-37.74642 c 1.5431,-1.55054 1.15361,-2.50522 -0.97234,-1.74389 l -28.12437,6.36667 c -1.1629,0.28631 -2.2347,0.85986 -3.11687,1.6686 -0.88124,0.8078 -1.54403,1.82383 -1.92702,2.95512 l -8.532589,27.35097 c -0.58331,2.11757 0.195211,2.69856 1.751319,1.14895 z" fill="#d30971" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="m 25.47096,131.56491 61.279242,18.86671 c 1.046984,0.19428 2.129198,0.0111 3.053291,-0.51685 0.924,-0.52707 1.629642,-1.36462 1.990783,-2.36205 l 10.268954,-32.74995 c 0.14873,-0.51034 0.19428,-1.04578 0.13479,-1.57378 -0.0586,-0.52893 -0.22217,-1.04019 -0.4806,-1.50591 -0.25842,-0.46572 -0.60608,-0.87566 -1.02346,-1.20752 -0.41738,-0.33093 -0.897043,-0.57727 -1.41017,-0.72322 L 38.004733,91.105883 c -1.037315,-0.295606 -2.149927,-0.170392 -3.095028,0.34822 -0.945009,0.518704 -1.645632,1.388696 -1.949046,2.420155 L 22.761334,126.55449 c -0.302949,1.02253 -0.188147,2.12222 0.31931,3.0611 0.507549,0.93794 1.366665,1.63884 2.390316,1.94932 z" fill="#d30971" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="m 5.6834977,64.52991 12.4226043,54.1901 c 0.389028,2.11758 1.389533,2.11758 1.931477,0 l 8.531849,-27.35115 c 0.290772,-1.165411 0.30267,-2.3826 0.03477,-3.553403 C 28.33629,86.644654 27.796019,85.552772 27.02698,84.628028 L 7.4343376,63.560918 C 6.0725724,61.969203 5.0581988,62.412053 5.6834977,64.52991 Z" fill="#d30971" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M 53.595516,6.602436 6.6564671,49.885345 c -0.7530573,0.714101 -1.1951843,1.693783 -1.2315519,2.728775 -0.036368,1.035084 0.3359197,2.043118 1.0370099,2.807882 L 29.931445,80.710788 c 0.723304,0.764299 1.72009,1.213378 2.773859,1.249632 1.05377,0.03635 2.079373,-0.343107 2.853897,-1.055815 l 46.92517,-43.352152 c 0.759558,-0.710384 1.206313,-1.691181 1.242752,-2.728404 0.03644,-1.037222 -0.340411,-2.046744 -1.048285,-2.808254 L 59.250973,6.7408501 C 58.890669,6.3587779 58.457672,6.0518109 57.977266,5.8377701 57.496767,5.6237302 56.978435,5.5068801 56.452294,5.4940029 55.926153,5.4811258 55.402708,5.5724784 54.912263,5.7627578 54.42191,5.9530368 53.974319,6.2384524 53.595516,6.602436 Z" fill="#d30971" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="m 98.964945,104.58764 c 2.139885,0.58192 3.487775,-0.56704 2.917945,-2.76828 L 88.30678,43.269262 C 87.723098,41.151498 85.972332,40.57014 84.429884,42.106546 L 40.214339,83.022555 c -1.556299,1.536406 -1.167177,3.266629 0.958767,3.847986 z" fill="#d30971" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M 122.0445,22.922017 68.519141,6.6026591 C 66.393197,6.0213059 66.004075,6.7964388 67.740991,8.5266523 L 87.333698,29.524435 c 0.878916,0.818493 1.941981,1.415188 3.099956,1.740262 1.158067,0.325166 2.377394,0.369135 3.556006,0.128374 l 28.12456,-6.353291 c 2.07017,-0.581357 2.07017,-1.550256 -0.0697,-2.117763 z" fill="#d30971" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.7 KiB |
@@ -416,6 +416,7 @@ const driverProfiles: Record<
|
||||
iotdb: { type: "iotdb", port: 6667, user: "root", label: "Apache IoTDB", icon: "iotdb" },
|
||||
etcd: { type: "etcd", port: 2379, user: "", label: "etcd", icon: "etcd" },
|
||||
iris: { type: "iris", port: 1972, user: "_SYSTEM", label: "IRIS", icon: "iris" },
|
||||
influxdb: { type: "influxdb", port: 8086, user: "", label: "InfluxDB", icon: "InfluxDB" },
|
||||
custom_mysql: {
|
||||
type: "mysql",
|
||||
port: 3306,
|
||||
@@ -715,6 +716,7 @@ const iconTypeMap: Record<string, string> = {
|
||||
bigquery: "bigquery",
|
||||
kylin: "kylin",
|
||||
sundb: "sundb",
|
||||
influxdb: "influxdb",
|
||||
jdbc: "jdbc",
|
||||
custom_mysql: "mysql",
|
||||
custom_postgres: "postgres",
|
||||
@@ -777,6 +779,7 @@ const dbOptions = [
|
||||
{ value: "xugu", label: "虚谷 XuguDB" },
|
||||
{ value: "iotdb", label: "Apache IoTDB" },
|
||||
{ value: "etcd", label: "etcd" },
|
||||
{ value: "influxdb", label: "InfluxDB" },
|
||||
{ value: "iris", label: "IRIS" },
|
||||
{ value: "jdbc", label: "JDBC" },
|
||||
{ value: "custom_mysql", label: "Custom (MySQL)" },
|
||||
@@ -824,7 +827,7 @@ const sqliteExtensionPaths = computed({
|
||||
form.value.url_params = setSqliteExtensionPaths(form.value.url_params, value);
|
||||
},
|
||||
});
|
||||
const tlsCapableDatabaseTypes = new Set<DatabaseType>(["mysql", "postgres", "redshift", "gaussdb", "kwdb", "opengauss", "redis", "etcd", "clickhouse", "elasticsearch"]);
|
||||
const tlsCapableDatabaseTypes = new Set<DatabaseType>(["mysql", "postgres", "redshift", "gaussdb", "kwdb", "opengauss", "redis", "etcd", "clickhouse", "elasticsearch", "influxdb"]);
|
||||
const supportsTlsToggle = computed(() => tlsCapableDatabaseTypes.has(form.value.db_type));
|
||||
const supportsCaCertificatePath = computed(() => form.value.db_type === "clickhouse");
|
||||
const bareMysqlProfiles = new Set(["doris", "starrocks", "selectdb", "oceanbase"]);
|
||||
|
||||
@@ -73,6 +73,7 @@ const assetIcons: Record<string, string> = {
|
||||
iotdb: "iotdb",
|
||||
etcd: "etcd",
|
||||
iris: "iris.png",
|
||||
influxdb: "influxdb",
|
||||
};
|
||||
|
||||
const letterIcons: Record<string, { letter: string; color: string }> = {};
|
||||
|
||||
@@ -184,7 +184,11 @@ function getIconInfo(node: TreeNode): { icon: any; colorClass: string } | null {
|
||||
case "view":
|
||||
return { icon: Eye, colorClass: "text-purple-500" };
|
||||
case "column":
|
||||
return { icon: Columns3, colorClass: "text-muted-foreground" };
|
||||
if ((node.meta as ColumnInfo).is_primary_key) {
|
||||
return { icon: Columns3, colorClass: "text-orange-400" };
|
||||
} else {
|
||||
return { icon: Columns3, colorClass: "text-muted-foreground" };
|
||||
}
|
||||
case "group-columns":
|
||||
return { icon: ListTree, colorClass: "text-green-400" };
|
||||
case "group-indexes":
|
||||
|
||||
@@ -145,6 +145,9 @@ export function connectionUrlPlaceholder(dbType: DatabaseType): string {
|
||||
case "iris":
|
||||
return "iris://user:password@host:port/namespace";
|
||||
|
||||
case "influxdb":
|
||||
return "influxdb://user:password@host:port/database";
|
||||
|
||||
case "jdbc":
|
||||
return "jdbc:mysql://host:3306/database";
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ export const TABLE_STRUCTURE_SUPPORTED_TYPES = new Set<DatabaseType>([
|
||||
"access",
|
||||
]);
|
||||
|
||||
export const CREATE_DATABASE_SUPPORTED_TYPES = new Set<DatabaseType>(["mysql", "postgres", "sqlserver", "clickhouse", "oracle", "gaussdb", "kwdb", "opengauss", "oceanbase-oracle", "doris", "starrocks", "redshift"]);
|
||||
export const CREATE_DATABASE_SUPPORTED_TYPES = new Set<DatabaseType>(["mysql", "postgres", "sqlserver", "clickhouse", "oracle", "gaussdb", "kwdb", "opengauss", "oceanbase-oracle", "doris", "starrocks", "redshift", "influxdb"]);
|
||||
|
||||
export const FIELD_LINEAGE_SUPPORTED_TYPES = new Set<DatabaseType>(["mysql", "postgres", "sqlite", "rqlite", "turso", "sqlserver", "oracle", "redshift", "dameng", "gaussdb", "kwdb", "opengauss", "oceanbase-oracle"]);
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ export function supportsObjectBrowserTreeNode(dbType: DatabaseType | undefined,
|
||||
}
|
||||
|
||||
export function supportsTableTruncate(dbType?: DatabaseType): boolean {
|
||||
return !!dbType && dbType !== "sqlite" && dbType !== "rqlite" && dbType !== "turso" && dbType !== "duckdb";
|
||||
return !!dbType && dbType !== "sqlite" && dbType !== "rqlite" && dbType !== "turso" && dbType !== "duckdb" && dbType !== "influxdb";
|
||||
}
|
||||
|
||||
export function usesPostgresLikeStructureCopy(dbType?: DatabaseType): boolean {
|
||||
|
||||
@@ -137,6 +137,18 @@ const DATABASE_CAPABILITY_OVERRIDES: Partial<Record<DatabaseType, Partial<Databa
|
||||
transaction: false,
|
||||
},
|
||||
},
|
||||
influxdb: {
|
||||
tableData: {
|
||||
insert: false,
|
||||
updateRequiresPrimaryKey: false,
|
||||
deleteRequiresPrimaryKey: true,
|
||||
keylessRowPredicate: false,
|
||||
requiresTransactionalTableForExistingRows: false,
|
||||
existingRowsReadonly: true,
|
||||
transaction: false,
|
||||
readonly: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
function defaultTableDataCapability(dbType?: DatabaseType): TableDataCapability {
|
||||
|
||||
@@ -50,6 +50,7 @@ const profileMap: Record<string, ConnectionProfile> = {
|
||||
gaussdb: { dbType: "gaussdb", profile: "gaussdb", label: "GaussDB", port: 5432, user: "gaussdb" },
|
||||
kwdb: { dbType: "kwdb", profile: "kwdb", label: "KWDB", port: 26257, user: "root" },
|
||||
opengauss: { dbType: "gaussdb", profile: "opengauss", label: "openGauss", port: 5432, user: "gaussdb" },
|
||||
influxdb: { dbType: "influxdb", profile: "influxdb", label: "InfluxDB", port: 8086, user: "" },
|
||||
};
|
||||
|
||||
function normalizeKey(value: unknown) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { DatabaseType } from "@/types/database";
|
||||
|
||||
export type TableStructureDialect = "mysql" | "postgres" | "sqlite" | "duckdb" | "sqlserver" | "oracle" | "h2" | "clickhouse" | "unsupported";
|
||||
export type TableStructureDialect = "mysql" | "postgres" | "sqlite" | "duckdb" | "sqlserver" | "oracle" | "h2" | "clickhouse" | "influxdb" | "unsupported";
|
||||
|
||||
export interface TableStructureCapabilities {
|
||||
dialect: TableStructureDialect;
|
||||
@@ -199,6 +199,20 @@ const accessCapabilities = capabilities({
|
||||
createIndex: true,
|
||||
});
|
||||
|
||||
const influxdbCapabilities = capabilities({
|
||||
dialect: "influxdb",
|
||||
createTable: false,
|
||||
addColumn: false,
|
||||
dropColumn: false,
|
||||
renameColumn: false,
|
||||
alterExistingColumn: false,
|
||||
alterType: false,
|
||||
alterNullability: false,
|
||||
alterDefault: false,
|
||||
reorderColumn: false,
|
||||
comment: false,
|
||||
});
|
||||
|
||||
const capabilityByType: Partial<Record<DatabaseType, TableStructureCapabilities>> = {
|
||||
mysql: mysqlCapabilities,
|
||||
doris: mysqlCapabilities,
|
||||
@@ -225,6 +239,7 @@ const capabilityByType: Partial<Record<DatabaseType, TableStructureCapabilities>
|
||||
h2: h2Capabilities,
|
||||
access: accessCapabilities,
|
||||
clickhouse: clickhouseCapabilities,
|
||||
influxdb: influxdbCapabilities,
|
||||
};
|
||||
|
||||
export function getTableStructureCapabilities(dbType?: DatabaseType): TableStructureCapabilities {
|
||||
|
||||
@@ -257,6 +257,7 @@ export const useConnectionStore = defineStore("connection", () => {
|
||||
bigquery: "BigQuery",
|
||||
kylin: "Kylin",
|
||||
sundb: "SunDB",
|
||||
influxdb: "InfluxDB",
|
||||
};
|
||||
|
||||
const profile = config.driver_profile || config.db_type;
|
||||
@@ -1201,7 +1202,8 @@ export const useConnectionStore = defineStore("connection", () => {
|
||||
},
|
||||
];
|
||||
|
||||
if (node.type === "table") {
|
||||
const config = getConfig(connectionId);
|
||||
if (node.type === "table" && config?.db_type !== "influxdb") {
|
||||
children.push(
|
||||
{
|
||||
id: `${parentId}:__indexes`,
|
||||
|
||||
@@ -49,6 +49,7 @@ export type DatabaseType =
|
||||
| "iotdb"
|
||||
| "etcd"
|
||||
| "iris"
|
||||
| "influxdb"
|
||||
| "jdbc";
|
||||
|
||||
export interface SqlSnippet {
|
||||
|
||||
Reference in New Issue
Block a user