arshadmohammad commented on code in PR #176: URL: https://github.com/apache/seatunnel-web/pull/176#discussion_r1712595787
########## seatunnel-datasource/seatunnel-datasource-plugins/datasource-console/src/main/java/org/apache/seatunnel/datasource/plugin/console/ConsoleDataSourceConfig.java: ########## @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 org.apache.seatunnel.datasource.plugin.console; + +import org.apache.seatunnel.api.configuration.Option; +import org.apache.seatunnel.api.configuration.Options; +import org.apache.seatunnel.api.configuration.util.OptionRule; +import org.apache.seatunnel.datasource.plugin.api.DataSourcePluginInfo; +import org.apache.seatunnel.datasource.plugin.api.DatasourcePluginTypeEnum; + +public class ConsoleDataSourceConfig { + + public static final String PLUGIN_NAME = "Console"; + + public static final DataSourcePluginInfo CONSOLE_DATASOURCE_PLUGIN_INFO = + DataSourcePluginInfo.builder() + .name(PLUGIN_NAME) + .icon(PLUGIN_NAME) + .version("1.0.0") + .type(DatasourcePluginTypeEnum.FAKE_CONNECTION.getCode()) + .build(); + + public static final Option<String> URL = + Options.key("url") + .stringType() + .defaultValue("dummy://URL") + .withDescription( + "This is required to meet the design constraints, however, it won't be utilized during execution."); Review Comment: I initially considered making this an optional option or even eliminating it entirely. However, due to the database design requirements, some form of value is necessary. This information will be stored in the "datasource_config" field of the "t_st_datasource" table, which expects a non-null value. Table Reference: ``` CREATE TABLE `t_st_datasource` ( `id` bigint(20) NOT NULL, `datasource_name` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `plugin_name` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `plugin_version` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '1.0.0', `datasource_config` varchar(1023) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `description` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL, `create_user_id` int(11) NOT NULL, `update_user_id` int(11) NOT NULL, `create_time` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), `update_time` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `t_st_datasource_datasource_name_uindex`(`datasource_name`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic; ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
