feat: add QuestDB support

Thanks @ptma!
This commit is contained in:
John Jin authored and GitHub committed 2026-06-14 22:58:05 +08:00
1 parent 0ae720d950
commit 1afc271c18
51 files changed
+633 -46

No files matched your search

+12 -7
View File
@@ -41,12 +41,14 @@ pub fn build_explain_sql(options: ExplainSqlOptions) -> ExplainSqlBuildResult {
return explain_err("unsafe");
}
let sql = if options.database_type == Some(DatabaseType::Postgres) {
format!("EXPLAIN (FORMAT JSON) {source}")
} else if options.database_type == Some(DatabaseType::Dameng) {
format!("EXPLAIN {source}")
} else {
format!("EXPLAIN FORMAT=JSON {source}")
let sql = match options.database_type {
Some(DatabaseType::Postgres | DatabaseType::MongoDb) => {
format!("EXPLAIN (FORMAT JSON) {source}")
}
Some(DatabaseType::Dameng | DatabaseType::Questdb) => {
format!("EXPLAIN {source}")
}
_ => format!("EXPLAIN FORMAT=JSON {source}"),
};
ExplainSqlBuildResult { ok: true, sql: Some(sql), reason: None }
}
@@ -71,7 +73,10 @@ pub fn build_dropped_file_preview_sql(options: DroppedFilePreviewSqlOptions) ->
}
pub fn supports_explain_plan(database_type: Option<DatabaseType>) -> bool {
matches!(database_type, Some(DatabaseType::Mysql | DatabaseType::Postgres | DatabaseType::Dameng))
matches!(
database_type,
Some(DatabaseType::Mysql | DatabaseType::Postgres | DatabaseType::Questdb | DatabaseType::Dameng)
)
}
pub fn is_safe_dameng_autotrace_sql(sql: &str) -> bool {