serialization of the gRPC JSONB now fully works for the validation

This commit is contained in:
Priec
2025-09-14 11:24:27 +02:00
parent d88c239bf6
commit ceb560c658
14 changed files with 25 additions and 4290 deletions

View File

@@ -77,12 +77,19 @@ impl TableValidationService for TableValidationSvc {
.map_err(|e| Status::internal(format!("serialize error: {e}")))?;
sqlx::query!(
r#"UPDATE table_validation_rules
SET config = $1, updated_at = now()
WHERE table_def_id = $2 AND data_key = $3"#,
json_value,
r#"
INSERT INTO table_validation_rules (
table_def_id, data_key, config, updated_at
)
VALUES ($1, $2, $3, now())
ON CONFLICT (table_def_id, data_key)
DO UPDATE SET
config = EXCLUDED.config,
updated_at = now()
"#,
table_def_id,
req.data_key
req.data_key,
json_value
)
.execute(&self.db)
.await