serialization of the gRPC JSONB now fully works for the validation
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user