Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public final class DBUtils {

public static final Calendar PURE_GREGORIAN_CALENDAR = createPureGregorianCalender();
public static final String MYSQL_SUPPORTED_DOC_URL = "https://dev.mysql.com/doc/mysql-errors/9.0/en/";
public static final String MSSQL_SUPPORTED_DOC_URL =
"https://docs.microsoft.com/en-us/sql/relational-databases/errors-events/database-engine-events-and-errors";
public static final String CLOUDSQLMYSQL_SUPPORTED_DOC_URL = "https://cloud.google.com/sql/docs/mysql/error-messages";
public static final String POSTGRES_SUPPORTED_DOC_URL =
"https://www.postgresql.org/docs/current/errcodes-appendix.html";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright © 2025 Cask Data, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

package io.cdap.plugin.mssql;

import io.cdap.plugin.common.db.DBErrorDetailsProvider;
import io.cdap.plugin.util.DBUtils;

/**
* A custom ErrorDetailsProvider for SQL Server plugins.
*/
public class SqlServerErrorDetailsProvider extends DBErrorDetailsProvider {

@Override
protected String getExternalDocumentationLink() {
return DBUtils.MSSQL_SUPPORTED_DOC_URL;
}
}
10 changes: 10 additions & 0 deletions mssql-plugin/src/main/java/io/cdap/plugin/mssql/SqlServerSink.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ protected LineageRecorder getLineageRecorder(BatchSinkContext context) {
return new LineageRecorder(context, asset);
}

@Override
protected String getErrorDetailsProviderClassName() {
return SqlServerErrorDetailsProvider.class.getName();
}

@Override
protected String getExternalDocumentationLink() {
return DBUtils.MSSQL_SUPPORTED_DOC_URL;
}

/**
* MSSQL action configuration.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ protected Class<? extends DBWritable> getDBRecordType() {
return SqlServerSourceDBRecord.class;
}

@Override
protected String getErrorDetailsProviderClassName() {
return SqlServerErrorDetailsProvider.class.getName();
}

@Override
protected LineageRecorder getLineageRecorder(BatchSourceContext context) {
String fqn = DBUtils.constructFQN("mssql",
Expand All @@ -85,6 +90,11 @@ protected LineageRecorder getLineageRecorder(BatchSourceContext context) {
return new LineageRecorder(context, asset);
}

@Override
protected String getExternalDocumentationLink() {
return DBUtils.MSSQL_SUPPORTED_DOC_URL;
}

/**
* MSSQL source config.
*/
Expand Down
Loading