From faf4ecd792a3df6da8ff94324d9ba743ccde8b62 Mon Sep 17 00:00:00 2001 From: zwang28 <70626450+zwang28@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:05:54 +0800 Subject: [PATCH] fix(sink): license SQL Server sink (#17910) --- src/connector/src/sink/sqlserver.rs | 4 ++++ src/license/src/feature.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/src/connector/src/sink/sqlserver.rs b/src/connector/src/sink/sqlserver.rs index c90ba256533f..0b8c7fa1f779 100644 --- a/src/connector/src/sink/sqlserver.rs +++ b/src/connector/src/sink/sqlserver.rs @@ -144,6 +144,10 @@ impl Sink for SqlServerSink { const SINK_NAME: &'static str = SQLSERVER_SINK; async fn validate(&self) -> Result<()> { + risingwave_common::license::Feature::SqlServerSink + .check_available() + .map_err(|e| anyhow::anyhow!(e))?; + if !self.is_append_only && self.pk_indices.is_empty() { return Err(SinkError::Config(anyhow!( "Primary key not defined for upsert SQL Server sink (please define in `primary_key` field)"))); diff --git a/src/license/src/feature.rs b/src/license/src/feature.rs index 186e15c998ae..9f59b63cc51c 100644 --- a/src/license/src/feature.rs +++ b/src/license/src/feature.rs @@ -47,6 +47,7 @@ macro_rules! for_all_features { { TimeTravel, Paid, "Query historical data within the retention period."}, { GlueSchemaRegistry, Paid, "Use Schema Registry from AWS Glue rather than Confluent." }, { SecretManagement, Paid, "Secret management." }, + { SqlServerSink, Paid, "Sink data from RisingWave to SQL Server." }, } }; }