feat: add rqlite database support

This commit is contained in:
t8y2
2026-06-05 01:02:07 +08:00
parent a799958328
commit 0887b96236
34 changed files with 804 additions and 12 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

@@ -229,6 +229,7 @@ const driverProfiles: Record<
},
redis: { type: "redis", port: 6379, user: "", label: "Redis", icon: "redis" },
sqlite: { type: "sqlite", port: 0, user: "", label: "SQLite", icon: "sqlite" },
rqlite: { type: "rqlite", port: 4001, user: "", label: "RQLite", icon: "rqlite" },
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" },
@@ -551,6 +552,7 @@ const iconTypeMap: Record<string, string> = {
mysql: "mysql",
postgres: "postgres",
sqlite: "sqlite",
rqlite: "rqlite",
access: "access",
redis: "redis",
mongodb: "mongodb",
@@ -611,6 +613,7 @@ const dbOptions = [
{ value: "mysql", label: "MySQL" },
{ value: "postgres", label: "PostgreSQL" },
{ value: "sqlite", label: "SQLite" },
{ value: "rqlite", label: "RQLite" },
{ value: "access", label: "Microsoft Access" },
{ value: "redis", label: "Redis" },
{ value: "mongodb", label: "MongoDB" },
@@ -11,6 +11,7 @@ const assetIcons: Record<string, string> = {
postgres: "postgres",
postgresql: "postgres",
sqlite: "sqlite",
rqlite: "rqlite.png",
redis: "redis",
mongodb: "mongodb",
clickhouse: "clickhouse",
@@ -158,6 +158,7 @@ const activeSqlFormatDialect = computed<SqlFormatDialect>(() => {
case "postgres":
return "postgres";
case "sqlite":
case "rqlite":
return "sqlite";
case "sqlserver":
return "sqlserver";
@@ -192,6 +192,7 @@ const sourceFormatDialect = computed<SqlFormatDialect>(() => {
case "mysql":
case "postgres":
case "sqlite":
case "rqlite":
case "sqlserver":
return effectiveDatabaseType.value;
case "gaussdb":
@@ -102,6 +102,9 @@ export function connectionUrlPlaceholder(dbType: DatabaseType): string {
case "sqlite":
return "sqlite:///absolute/path/to/database.db";
case "rqlite":
return "http://user:password@host:4001";
case "duckdb":
return "duckdb:///absolute/path/to/database.duckdb";
@@ -37,6 +37,7 @@ export const DIAGRAM_SUPPORTED_TYPES = new Set<DatabaseType>([
"mysql",
"postgres",
"sqlite",
"rqlite",
"sqlserver",
"oracle",
"redshift",
@@ -66,6 +67,7 @@ export const DATABASE_SEARCH_SUPPORTED_TYPES = new Set<DatabaseType>([
"mysql",
"postgres",
"sqlite",
"rqlite",
"sqlserver",
"oracle",
"redshift",
@@ -108,6 +110,7 @@ export const TABLE_IMPORT_SUPPORTED_TYPES = new Set<DatabaseType>([
"mysql",
"postgres",
"sqlite",
"rqlite",
"duckdb",
"clickhouse",
"sqlserver",
@@ -129,6 +132,7 @@ export const TABLE_STRUCTURE_SUPPORTED_TYPES = new Set<DatabaseType>([
"mysql",
"postgres",
"sqlite",
"rqlite",
"duckdb",
"clickhouse",
"sqlserver",
@@ -169,6 +173,7 @@ export const FIELD_LINEAGE_SUPPORTED_TYPES = new Set<DatabaseType>([
"mysql",
"postgres",
"sqlite",
"rqlite",
"sqlserver",
"oracle",
"redshift",
@@ -258,6 +263,7 @@ export const TRANSFER_SQL_TYPES = new Set<DatabaseType>([
"mysql",
"postgres",
"sqlite",
"rqlite",
"sqlserver",
"oracle",
"clickhouse",
@@ -272,6 +278,7 @@ export const DIAGRAM_SQL_TYPES = new Set<DatabaseType>([
"mysql",
"postgres",
"sqlite",
"rqlite",
"sqlserver",
"oracle",
"redshift",
@@ -104,7 +104,7 @@ export function supportsObjectBrowserTreeNode(dbType: DatabaseType | undefined,
}
export function supportsTableTruncate(dbType?: DatabaseType): boolean {
return !!dbType && dbType !== "sqlite" && dbType !== "duckdb";
return !!dbType && dbType !== "sqlite" && dbType !== "rqlite" && dbType !== "duckdb";
}
export function usesPostgresLikeStructureCopy(dbType?: DatabaseType): boolean {
@@ -49,6 +49,7 @@ const NAVICAT_STYLE_TABLE_DATA_TYPES = new Set<DatabaseType>([
"mysql",
"postgres",
"sqlite",
"rqlite",
"duckdb",
"sqlserver",
"oracle",
+1 -1
View File
@@ -31,7 +31,7 @@ export function supportsObjectRename(
if (objectType === "PROCEDURE" || objectType === "FUNCTION") {
return false;
}
if (databaseType === "sqlite") return objectType === "TABLE";
if (databaseType === "sqlite" || databaseType === "rqlite") return objectType === "TABLE";
if (databaseType === "mysql" || databaseType === "goldendb") return objectType === "TABLE" || objectType === "VIEW";
if (postgresLikeRenameTypes.has(databaseType)) return objectType === "TABLE" || objectType === "VIEW";
if (oracleLikeRenameTypes.has(databaseType)) return objectType === "TABLE" || objectType === "VIEW";
+2
View File
@@ -451,6 +451,7 @@ const DATABASE_SQL_KEYWORDS: Partial<Record<DatabaseType, string[]>> = {
mysql: MYSQL_SQL_KEYWORDS,
postgres: POSTGRES_SQL_KEYWORDS,
sqlite: SQLITE_SQL_KEYWORDS,
rqlite: SQLITE_SQL_KEYWORDS,
sqlserver: SQLSERVER_SQL_KEYWORDS,
};
@@ -848,6 +849,7 @@ const DATABASE_FUNCTION_SIGNATURES: Partial<Record<DatabaseType, Map<string, str
mysql: MYSQL_FUNCTION_SIGNATURES,
postgres: POSTGRES_FUNCTION_SIGNATURES,
sqlite: SQLITE_FUNCTION_SIGNATURES,
rqlite: SQLITE_FUNCTION_SIGNATURES,
sqlserver: SQLSERVER_FUNCTION_SIGNATURES,
};
@@ -222,6 +222,7 @@ const capabilityByType: Partial<Record<DatabaseType, TableStructureCapabilities>
vastbase: postgresCapabilities,
kingbase: postgresCapabilities,
sqlite: sqliteCapabilities,
rqlite: sqliteCapabilities,
duckdb: duckdbCapabilities,
sqlserver: sqlserverCapabilities,
oracle: oracleCapabilities,
@@ -114,6 +114,7 @@ export const DATA_TYPE_OPTIONS: Record<string, string[]> = {
"oid",
],
sqlite: ["integer", "real", "text", "blob", "numeric"],
rqlite: ["integer", "real", "text", "blob", "numeric"],
sqlserver: [
"bit",
"tinyint",
+1
View File
@@ -2,6 +2,7 @@ export type DatabaseType =
| "mysql"
| "postgres"
| "sqlite"
| "rqlite"
| "redis"
| "duckdb"
| "clickhouse"