未验证 提交 8130da3f 编写于 作者: L Liang Zhang 提交者: GitHub

Merge shardingsphere-distsql-parser-binder into shardingsphere-infra-binder (#7993)

上级 4ebe65d2
......@@ -32,6 +32,5 @@
<modules>
<module>shardingsphere-distsql-parser-statement</module>
<module>shardingsphere-distsql-parser-engine</module>
<module>shardingsphere-distsql-parser-binder</module>
</modules>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-distsql-parser</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
<artifactId>shardingsphere-distsql-parser-binder</artifactId>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-infra-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-distsql-parser-statement</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-infra-binder</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
......@@ -29,12 +29,7 @@
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-infra-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-distsql-parser-binder</artifactId>
<artifactId>shardingsphere-infra-binder</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
......
......@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sharding.converter;
import com.google.common.base.Joiner;
import org.apache.shardingsphere.infra.yaml.config.algorithm.YamlShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.distsql.parser.binder.context.CreateShardingRuleStatementContext;
import org.apache.shardingsphere.infra.binder.statement.rdl.CreateShardingRuleStatementContext;
import org.apache.shardingsphere.infra.binder.converter.SQLStatementContextConverter;
import org.apache.shardingsphere.distsql.parser.statement.rdl.TableRuleSegment;
import org.apache.shardingsphere.sharding.yaml.config.YamlShardingRuleConfiguration;
......
......@@ -17,7 +17,7 @@
package org.apache.shardingsphere.sharding.converter;
import org.apache.shardingsphere.distsql.parser.binder.context.CreateShardingRuleStatementContext;
import org.apache.shardingsphere.infra.binder.statement.rdl.CreateShardingRuleStatementContext;
import org.apache.shardingsphere.distsql.parser.statement.rdl.CreateShardingRuleStatement;
import org.apache.shardingsphere.distsql.parser.statement.rdl.TableRuleSegment;
import org.apache.shardingsphere.sharding.yaml.config.YamlShardingRuleConfiguration;
......
......@@ -15,11 +15,11 @@
* limitations under the License.
*/
package org.apache.shardingsphere.distsql.parser.binder.context;
package org.apache.shardingsphere.infra.binder.statement.rdl;
import lombok.Getter;
import org.apache.shardingsphere.infra.binder.statement.rdl.util.DataSourceConnectionUrlUtil;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.distsql.parser.binder.util.DataSourceConnectionUrlUtil;
import org.apache.shardingsphere.distsql.parser.statement.rdl.CreateDataSourcesStatement;
import org.apache.shardingsphere.distsql.parser.statement.rdl.DataSourceConnectionSegment;
import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
......
......@@ -15,12 +15,12 @@
* limitations under the License.
*/
package org.apache.shardingsphere.distsql.parser.binder.context;
package org.apache.shardingsphere.infra.binder.statement.rdl;
import org.apache.shardingsphere.distsql.parser.binder.util.ShardingAlgorithmPropertiesUtil;
import org.apache.shardingsphere.distsql.parser.statement.rdl.CreateShardingRuleStatement;
import org.apache.shardingsphere.distsql.parser.statement.rdl.TableRuleSegment;
import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
import org.apache.shardingsphere.infra.binder.statement.rdl.util.ShardingAlgorithmPropertiesUtil;
import java.util.Properties;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.shardingsphere.distsql.parser.binder.util;
package org.apache.shardingsphere.infra.binder.statement.rdl.util;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
......@@ -41,7 +41,6 @@ public final class DataSourceConnectionUrlUtil {
}
private static String getUrl(final DataSourceConnectionSegment connectionSegment, final String jdbcUrlPrefix) {
return String.format("%s//%s:%s/%s", jdbcUrlPrefix,
connectionSegment.getHostName(), connectionSegment.getPort(), connectionSegment.getDb());
return String.format("%s//%s:%s/%s", jdbcUrlPrefix, connectionSegment.getHostName(), connectionSegment.getPort(), connectionSegment.getDb());
}
}
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.shardingsphere.distsql.parser.binder.util;
package org.apache.shardingsphere.infra.binder.statement.rdl.util;
import com.google.common.base.Preconditions;
import lombok.AccessLevel;
......
......@@ -15,14 +15,14 @@
* limitations under the License.
*/
package org.apache.shardingsphere.distsql.parser.binder.util;
package org.apache.shardingsphere.infra.binder.statement.rdl.util;
import org.apache.shardingsphere.distsql.parser.statement.rdl.DataSourceConnectionSegment;
import org.apache.shardingsphere.infra.database.type.dialect.MariaDBDatabaseType;
import org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
import org.apache.shardingsphere.infra.database.type.dialect.OracleDatabaseType;
import org.apache.shardingsphere.infra.database.type.dialect.PostgreSQLDatabaseType;
import org.apache.shardingsphere.infra.database.type.dialect.SQLServerDatabaseType;
import org.apache.shardingsphere.distsql.parser.statement.rdl.DataSourceConnectionSegment;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
......@@ -32,7 +32,7 @@ import static org.junit.Assert.assertThat;
@RunWith(MockitoJUnitRunner.class)
public final class DataSourceConnectionUrlUtilTest {
@Test
public void assertMySQLGetUrl() {
DataSourceConnectionSegment segment = buildDataSourceConnectionSegment();
......@@ -41,7 +41,7 @@ public final class DataSourceConnectionUrlUtilTest {
String expected = "jdbc:mysql://127.0.0.1:3306/test";
assertThat(actual, is(expected));
}
@Test
public void assertPostgreSQLGetUrl() {
DataSourceConnectionSegment segment = buildDataSourceConnectionSegment();
......@@ -50,7 +50,7 @@ public final class DataSourceConnectionUrlUtilTest {
String expected = "jdbc:postgresql://127.0.0.1:3306/test";
assertThat(actual, is(expected));
}
@Test
public void assertMariaDBGetUrl() {
DataSourceConnectionSegment segment = buildDataSourceConnectionSegment();
......@@ -59,7 +59,7 @@ public final class DataSourceConnectionUrlUtilTest {
String expected = "jdbc:mariadb://127.0.0.1:3306/test";
assertThat(actual, is(expected));
}
@Test
public void assertOracleGetUrl() {
DataSourceConnectionSegment segment = buildDataSourceConnectionSegment();
......@@ -68,7 +68,7 @@ public final class DataSourceConnectionUrlUtilTest {
String expected = "jdbc:oracle://127.0.0.1:3306/test";
assertThat(actual, is(expected));
}
@Test
public void assertSQLServerGetUrl() {
DataSourceConnectionSegment segment = buildDataSourceConnectionSegment();
......@@ -79,11 +79,11 @@ public final class DataSourceConnectionUrlUtilTest {
}
private DataSourceConnectionSegment buildDataSourceConnectionSegment() {
DataSourceConnectionSegment segment = new DataSourceConnectionSegment();
segment.setHostName("127.0.0.1");
segment.setDb("test");
segment.setUser("root");
segment.setPort("3306");
return segment;
DataSourceConnectionSegment result = new DataSourceConnectionSegment();
result.setHostName("127.0.0.1");
result.setDb("test");
result.setUser("root");
result.setPort("3306");
return result;
}
}
......@@ -52,11 +52,6 @@
<artifactId>shardingsphere-sql-parser-sqlserver</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-distsql-parser-binder</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-db-protocol-core</artifactId>
......
......@@ -37,8 +37,8 @@ import org.apache.shardingsphere.proxy.backend.text.TextProtocolBackendHandler;
import org.apache.shardingsphere.proxy.config.util.DataSourceParameterConverter;
import org.apache.shardingsphere.proxy.config.yaml.YamlDataSourceParameter;
import org.apache.shardingsphere.proxy.converter.CreateDataSourcesStatementContextConverter;
import org.apache.shardingsphere.distsql.parser.binder.context.CreateDataSourcesStatementContext;
import org.apache.shardingsphere.distsql.parser.binder.context.CreateShardingRuleStatementContext;
import org.apache.shardingsphere.infra.binder.statement.rdl.CreateDataSourcesStatementContext;
import org.apache.shardingsphere.infra.binder.statement.rdl.CreateShardingRuleStatementContext;
import org.apache.shardingsphere.distsql.parser.statement.rdl.CreateDataSourcesStatement;
import org.apache.shardingsphere.distsql.parser.statement.rdl.CreateShardingRuleStatement;
import org.apache.shardingsphere.sharding.converter.CreateShardingRuleStatementContextConverter;
......
......@@ -57,11 +57,7 @@
<artifactId>shardingsphere-encrypt-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-distsql-parser-binder</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
......
......@@ -19,7 +19,7 @@ package org.apache.shardingsphere.proxy.converter;
import org.apache.shardingsphere.infra.config.datasource.DataSourceParameter;
import org.apache.shardingsphere.proxy.config.yaml.YamlDataSourceParameter;
import org.apache.shardingsphere.distsql.parser.binder.context.CreateDataSourcesStatementContext;
import org.apache.shardingsphere.infra.binder.statement.rdl.CreateDataSourcesStatementContext;
import org.apache.shardingsphere.infra.binder.converter.SQLStatementContextConverter;
import org.apache.shardingsphere.distsql.parser.statement.rdl.DataSourceConnectionSegment;
......
......@@ -19,7 +19,7 @@ package org.apache.shardingsphere.proxy.converter;
import org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
import org.apache.shardingsphere.proxy.config.yaml.YamlDataSourceParameter;
import org.apache.shardingsphere.distsql.parser.binder.context.CreateDataSourcesStatementContext;
import org.apache.shardingsphere.infra.binder.statement.rdl.CreateDataSourcesStatementContext;
import org.apache.shardingsphere.distsql.parser.statement.rdl.CreateDataSourcesStatement;
import org.apache.shardingsphere.distsql.parser.statement.rdl.DataSourceConnectionSegment;
import org.junit.Before;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册