feat(db): 支持 VictoriaMetrics 数据库
* feat(victoriametrics): support native MetricsQL queries * fix(victoriametrics): 完善指标浏览和结果导出 * fix(victoriametrics): 修复指标对象通用操作入口 * fix(victoriametrics): 修正指标注释和截断提示 * fix(i18n): 补齐 VictoriaMetrics 连接配置翻译 --------- Co-authored-by: zipg <4047349+zipg@users.noreply.github.com>
This commit is contained in:
1 parent
930aa48c20
commit
2ede64f1cb
64 files changed
+1293
-64
No files matched your search
@@ -150,6 +150,9 @@ fn supports_data_grid_context_filter_mode(
|
||||
database_type: Option<DatabaseType>,
|
||||
mode: DataGridContextFilterMode,
|
||||
) -> bool {
|
||||
if database_type == Some(DatabaseType::VictoriaMetrics) {
|
||||
return false;
|
||||
}
|
||||
!matches!(
|
||||
(database_type, mode),
|
||||
(
|
||||
@@ -3767,6 +3770,33 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn does_not_emit_sql_filters_for_victoriametrics() {
|
||||
for mode in [
|
||||
DataGridContextFilterMode::Equals,
|
||||
DataGridContextFilterMode::Like,
|
||||
DataGridContextFilterMode::GreaterThan,
|
||||
DataGridContextFilterMode::IsNull,
|
||||
DataGridContextFilterMode::In,
|
||||
DataGridContextFilterMode::Between,
|
||||
] {
|
||||
assert_eq!(
|
||||
build_data_grid_context_filter_condition(DataGridContextFilterConditionOptions {
|
||||
database_type: Some(DatabaseType::VictoriaMetrics),
|
||||
identifier_quote: None,
|
||||
column_name: "value".to_string(),
|
||||
mode,
|
||||
value: json!(10),
|
||||
values: vec![json!(10), json!(20)],
|
||||
end_value: Some(json!(20)),
|
||||
column_info: Some(column("value", "double", false, None)),
|
||||
}),
|
||||
None,
|
||||
"VictoriaMetrics must not emit SQL filter mode {mode:?}"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn context_membership_and_range_filters_require_complete_values() {
|
||||
let column_info = Some(column("score", "int", false, None));
|
||||
|
||||
Reference in new issue
Block a user