Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
b7e01921
Shardingsphere
项目概览
apache
/
Shardingsphere
通知
56
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Shardingsphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b7e01921
编写于
3月 13, 2019
作者:
T
terrymanu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
for #1864, use spi for sql parser
上级
06a9e500
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
350 addition
and
52 deletion
+350
-52
sharding-core/sharding-core-parser/pom.xml
sharding-core/sharding-core-parser/pom.xml
+1
-0
sharding-core/sharding-core-parser/sharding-core-parser-common/pom.xml
.../sharding-core-parser/sharding-core-parser-common/pom.xml
+5
-0
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/parser/impl/SQLParserFactory.java
...here/core/parsing/antlr/parser/impl/SQLParserFactory.java
+12
-47
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/parser/impl/dialect/MySQLParser.java
...e/core/parsing/antlr/parser/impl/dialect/MySQLParser.java
+1
-1
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/parser/impl/dialect/OracleParser.java
.../core/parsing/antlr/parser/impl/dialect/OracleParser.java
+1
-1
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/parser/impl/dialect/PostgreSQLParser.java
...e/parsing/antlr/parser/impl/dialect/PostgreSQLParser.java
+1
-1
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/parser/impl/dialect/SQLServerParser.java
...re/parsing/antlr/parser/impl/dialect/SQLServerParser.java
+1
-1
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/spi/H2ShardingParseEngine.java
...gsphere/core/parsing/antlr/spi/H2ShardingParseEngine.java
+43
-0
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/spi/MySQLShardingParseEngine.java
...here/core/parsing/antlr/spi/MySQLShardingParseEngine.java
+43
-0
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/spi/OracleShardingParseEngine.java
...ere/core/parsing/antlr/spi/OracleShardingParseEngine.java
+43
-0
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/spi/PostgreSQLShardingParseEngine.java
...core/parsing/antlr/spi/PostgreSQLShardingParseEngine.java
+43
-0
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/spi/SQLServerShardingParseEngine.java
.../core/parsing/antlr/spi/SQLServerShardingParseEngine.java
+43
-0
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/resources/META-INF/services/org.apache.shardingsphere.core.parsing.spi.ShardingParseEngine
...pache.shardingsphere.core.parsing.spi.ShardingParseEngine
+39
-0
sharding-core/sharding-core-parser/sharding-core-parser-spi/pom.xml
...ore/sharding-core-parser/sharding-core-parser-spi/pom.xml
+30
-0
sharding-core/sharding-core-parser/sharding-core-parser-spi/src/main/java/org/apache/shardingsphere/core/parsing/api/SQLParser.java
...org/apache/shardingsphere/core/parsing/api/SQLParser.java
+1
-1
sharding-core/sharding-core-parser/sharding-core-parser-spi/src/main/java/org/apache/shardingsphere/core/parsing/spi/ShardingParseEngine.java
.../shardingsphere/core/parsing/spi/ShardingParseEngine.java
+43
-0
未找到文件。
sharding-core/sharding-core-parser/pom.xml
浏览文件 @
b7e01921
...
...
@@ -33,6 +33,7 @@
<module>
sharding-core-parser-postgresql
</module>
<module>
sharding-core-parser-oracle
</module>
<module>
sharding-core-parser-sqlserver
</module>
<module>
sharding-core-parser-spi
</module>
</modules>
<dependencies>
...
...
sharding-core/sharding-core-parser/sharding-core-parser-common/pom.xml
浏览文件 @
b7e01921
...
...
@@ -39,6 +39,11 @@
<artifactId>
sharding-core-common
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.shardingsphere
</groupId>
<artifactId>
sharding-core-parser-spi
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.shardingsphere
</groupId>
<artifactId>
sharding-core-parser-mysql
</artifactId>
...
...
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/parser/impl/SQLParserFactory.java
浏览文件 @
b7e01921
...
...
@@ -19,20 +19,10 @@ package org.apache.shardingsphere.core.parsing.antlr.parser.impl;
import
lombok.AccessLevel
;
import
lombok.NoArgsConstructor
;
import
org.antlr.v4.runtime.CharStream
;
import
org.antlr.v4.runtime.CharStreams
;
import
org.antlr.v4.runtime.CommonTokenStream
;
import
org.antlr.v4.runtime.Lexer
;
import
org.antlr.v4.runtime.TokenStream
;
import
org.apache.shardingsphere.core.constant.DatabaseType
;
import
org.apache.shardingsphere.core.parsing.antlr.autogen.MySQLStatementLexer
;
import
org.apache.shardingsphere.core.parsing.antlr.autogen.OracleStatementLexer
;
import
org.apache.shardingsphere.core.parsing.antlr.autogen.PostgreSQLStatementLexer
;
import
org.apache.shardingsphere.core.parsing.antlr.autogen.SQLServerStatementLexer
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.impl.dialect.MySQLParser
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.impl.dialect.OracleParser
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.impl.dialect.PostgreSQLParser
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.impl.dialect.SQLServerParser
;
import
org.apache.shardingsphere.core.parsing.api.SQLParser
;
import
org.apache.shardingsphere.core.parsing.spi.ShardingParseEngine
;
import
org.apache.shardingsphere.core.spi.NewInstanceServiceLoader
;
/**
* SQL parser factory.
...
...
@@ -43,6 +33,10 @@ import org.apache.shardingsphere.core.parsing.antlr.parser.impl.dialect.SQLServe
@NoArgsConstructor
(
access
=
AccessLevel
.
PRIVATE
)
public
final
class
SQLParserFactory
{
static
{
NewInstanceServiceLoader
.
register
(
ShardingParseEngine
.
class
);
}
/**
* New instance of SQL parser.
*
...
...
@@ -51,40 +45,11 @@ public final class SQLParserFactory {
* @return SQL parser
*/
public
static
SQLParser
newInstance
(
final
DatabaseType
databaseType
,
final
String
sql
)
{
return
createSQLParser
(
databaseType
,
createLexer
(
databaseType
,
sql
));
}
private
static
Lexer
createLexer
(
final
DatabaseType
databaseType
,
final
String
sql
)
{
CharStream
sqlCharStream
=
CharStreams
.
fromString
(
sql
);
switch
(
databaseType
)
{
case
H2:
case
MySQL:
return
new
MySQLStatementLexer
(
sqlCharStream
);
case
PostgreSQL:
return
new
PostgreSQLStatementLexer
(
sqlCharStream
);
case
SQLServer:
return
new
SQLServerStatementLexer
(
sqlCharStream
);
case
Oracle:
return
new
OracleStatementLexer
(
sqlCharStream
);
default
:
throw
new
UnsupportedOperationException
(
String
.
format
(
"Can not support database type [%s]."
,
databaseType
));
}
}
private
static
SQLParser
createSQLParser
(
final
DatabaseType
databaseType
,
final
Lexer
lexer
)
{
TokenStream
tokenStream
=
new
CommonTokenStream
(
lexer
);
switch
(
databaseType
)
{
case
H2:
case
MySQL:
return
new
MySQLParser
(
tokenStream
);
case
PostgreSQL:
return
new
PostgreSQLParser
(
tokenStream
);
case
SQLServer:
return
new
SQLServerParser
(
tokenStream
);
case
Oracle:
return
new
OracleParser
(
tokenStream
);
default
:
throw
new
UnsupportedOperationException
(
String
.
format
(
"Can not support database type [%s]."
,
databaseType
));
for
(
ShardingParseEngine
each
:
NewInstanceServiceLoader
.
newServiceInstances
(
ShardingParseEngine
.
class
))
{
if
(
DatabaseType
.
valueOf
(
each
.
getDatabaseType
())
==
databaseType
)
{
return
each
.
createSQLParser
(
sql
);
}
}
throw
new
UnsupportedOperationException
(
String
.
format
(
"Cannot support database type '%s'"
,
databaseType
));
}
}
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/parser/impl/dialect/MySQLParser.java
浏览文件 @
b7e01921
...
...
@@ -24,7 +24,7 @@ import org.apache.shardingsphere.core.parsing.antlr.autogen.MySQLStatementParser
import
org.apache.shardingsphere.core.parsing.antlr.parser.advanced.AdvancedErrorStrategy
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.advanced.AdvancedMatchHandler
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.advanced.AdvancedParserATNSimulator
;
import
org.apache.shardingsphere.core.parsing.a
ntlr.parser.impl
.SQLParser
;
import
org.apache.shardingsphere.core.parsing.a
pi
.SQLParser
;
/**
* SQL parser for MySQL.
...
...
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/parser/impl/dialect/OracleParser.java
浏览文件 @
b7e01921
...
...
@@ -24,7 +24,7 @@ import org.apache.shardingsphere.core.parsing.antlr.autogen.OracleStatementParse
import
org.apache.shardingsphere.core.parsing.antlr.parser.advanced.AdvancedErrorStrategy
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.advanced.AdvancedMatchHandler
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.advanced.AdvancedParserATNSimulator
;
import
org.apache.shardingsphere.core.parsing.a
ntlr.parser.impl
.SQLParser
;
import
org.apache.shardingsphere.core.parsing.a
pi
.SQLParser
;
/**
* SQL parser for Oracle.
...
...
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/parser/impl/dialect/PostgreSQLParser.java
浏览文件 @
b7e01921
...
...
@@ -24,7 +24,7 @@ import org.apache.shardingsphere.core.parsing.antlr.autogen.PostgreSQLStatementP
import
org.apache.shardingsphere.core.parsing.antlr.parser.advanced.AdvancedErrorStrategy
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.advanced.AdvancedMatchHandler
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.advanced.AdvancedParserATNSimulator
;
import
org.apache.shardingsphere.core.parsing.a
ntlr.parser.impl
.SQLParser
;
import
org.apache.shardingsphere.core.parsing.a
pi
.SQLParser
;
/**
* SQL parser for PostgreSQL.
...
...
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/parser/impl/dialect/SQLServerParser.java
浏览文件 @
b7e01921
...
...
@@ -24,7 +24,7 @@ import org.apache.shardingsphere.core.parsing.antlr.autogen.SQLServerStatementPa
import
org.apache.shardingsphere.core.parsing.antlr.parser.advanced.AdvancedErrorStrategy
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.advanced.AdvancedMatchHandler
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.advanced.AdvancedParserATNSimulator
;
import
org.apache.shardingsphere.core.parsing.a
ntlr.parser.impl
.SQLParser
;
import
org.apache.shardingsphere.core.parsing.a
pi
.SQLParser
;
/**
* SQL parser for SQLServer.
...
...
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/spi/H2ShardingParseEngine.java
0 → 100644
浏览文件 @
b7e01921
/*
* 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.shardingsphere.core.parsing.antlr.spi
;
import
org.antlr.v4.runtime.CharStreams
;
import
org.antlr.v4.runtime.CommonTokenStream
;
import
org.apache.shardingsphere.core.constant.DatabaseType
;
import
org.apache.shardingsphere.core.parsing.antlr.autogen.MySQLStatementLexer
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.impl.dialect.MySQLParser
;
import
org.apache.shardingsphere.core.parsing.spi.ShardingParseEngine
;
/**
* Sharding parse engine for H2.
*
* @author zhangliang
*/
public
final
class
H2ShardingParseEngine
implements
ShardingParseEngine
{
@Override
public
String
getDatabaseType
()
{
return
DatabaseType
.
H2
.
name
();
}
@Override
public
MySQLParser
createSQLParser
(
final
String
sql
)
{
return
new
MySQLParser
(
new
CommonTokenStream
(
new
MySQLStatementLexer
(
CharStreams
.
fromString
(
sql
))));
}
}
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/spi/MySQLShardingParseEngine.java
0 → 100644
浏览文件 @
b7e01921
/*
* 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.shardingsphere.core.parsing.antlr.spi
;
import
org.antlr.v4.runtime.CharStreams
;
import
org.antlr.v4.runtime.CommonTokenStream
;
import
org.apache.shardingsphere.core.constant.DatabaseType
;
import
org.apache.shardingsphere.core.parsing.antlr.autogen.MySQLStatementLexer
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.impl.dialect.MySQLParser
;
import
org.apache.shardingsphere.core.parsing.spi.ShardingParseEngine
;
/**
* Sharding parse engine for MySQL.
*
* @author zhangliang
*/
public
final
class
MySQLShardingParseEngine
implements
ShardingParseEngine
{
@Override
public
String
getDatabaseType
()
{
return
DatabaseType
.
MySQL
.
name
();
}
@Override
public
MySQLParser
createSQLParser
(
final
String
sql
)
{
return
new
MySQLParser
(
new
CommonTokenStream
(
new
MySQLStatementLexer
(
CharStreams
.
fromString
(
sql
))));
}
}
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/spi/OracleShardingParseEngine.java
0 → 100644
浏览文件 @
b7e01921
/*
* 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.shardingsphere.core.parsing.antlr.spi
;
import
org.antlr.v4.runtime.CharStreams
;
import
org.antlr.v4.runtime.CommonTokenStream
;
import
org.apache.shardingsphere.core.constant.DatabaseType
;
import
org.apache.shardingsphere.core.parsing.antlr.autogen.OracleStatementLexer
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.impl.dialect.OracleParser
;
import
org.apache.shardingsphere.core.parsing.spi.ShardingParseEngine
;
/**
* Sharding parse engine for Oracle.
*
* @author zhangliang
*/
public
final
class
OracleShardingParseEngine
implements
ShardingParseEngine
{
@Override
public
String
getDatabaseType
()
{
return
DatabaseType
.
Oracle
.
name
();
}
@Override
public
OracleParser
createSQLParser
(
final
String
sql
)
{
return
new
OracleParser
(
new
CommonTokenStream
(
new
OracleStatementLexer
(
CharStreams
.
fromString
(
sql
))));
}
}
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/spi/PostgreSQLShardingParseEngine.java
0 → 100644
浏览文件 @
b7e01921
/*
* 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.shardingsphere.core.parsing.antlr.spi
;
import
org.antlr.v4.runtime.CharStreams
;
import
org.antlr.v4.runtime.CommonTokenStream
;
import
org.apache.shardingsphere.core.constant.DatabaseType
;
import
org.apache.shardingsphere.core.parsing.antlr.autogen.PostgreSQLStatementLexer
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.impl.dialect.PostgreSQLParser
;
import
org.apache.shardingsphere.core.parsing.spi.ShardingParseEngine
;
/**
* Sharding parse engine for PostgreSQL.
*
* @author zhangliang
*/
public
final
class
PostgreSQLShardingParseEngine
implements
ShardingParseEngine
{
@Override
public
String
getDatabaseType
()
{
return
DatabaseType
.
PostgreSQL
.
name
();
}
@Override
public
PostgreSQLParser
createSQLParser
(
final
String
sql
)
{
return
new
PostgreSQLParser
(
new
CommonTokenStream
(
new
PostgreSQLStatementLexer
(
CharStreams
.
fromString
(
sql
))));
}
}
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/spi/SQLServerShardingParseEngine.java
0 → 100644
浏览文件 @
b7e01921
/*
* 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.shardingsphere.core.parsing.antlr.spi
;
import
org.antlr.v4.runtime.CharStreams
;
import
org.antlr.v4.runtime.CommonTokenStream
;
import
org.apache.shardingsphere.core.constant.DatabaseType
;
import
org.apache.shardingsphere.core.parsing.antlr.autogen.SQLServerStatementLexer
;
import
org.apache.shardingsphere.core.parsing.antlr.parser.impl.dialect.SQLServerParser
;
import
org.apache.shardingsphere.core.parsing.spi.ShardingParseEngine
;
/**
* Sharding parse engine for SQLServer.
*
* @author zhangliang
*/
public
final
class
SQLServerShardingParseEngine
implements
ShardingParseEngine
{
@Override
public
String
getDatabaseType
()
{
return
DatabaseType
.
SQLServer
.
name
();
}
@Override
public
SQLServerParser
createSQLParser
(
final
String
sql
)
{
return
new
SQLServerParser
(
new
CommonTokenStream
(
new
SQLServerStatementLexer
(
CharStreams
.
fromString
(
sql
))));
}
}
sharding-core/sharding-core-parser/sharding-core-parser-common/src/main/resources/META-INF/services/org.apache.shardingsphere.core.parsing.spi.ShardingParseEngine
0 → 100644
浏览文件 @
b7e01921
#
# 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.
#
#
# 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.
#
org.apache.shardingsphere.core.parsing.antlr.spi.MySQLShardingParseEngine
org.apache.shardingsphere.core.parsing.antlr.spi.PostgreSQLShardingParseEngine
org.apache.shardingsphere.core.parsing.antlr.spi.SQLServerShardingParseEngine
org.apache.shardingsphere.core.parsing.antlr.spi.OracleShardingParseEngine
org.apache.shardingsphere.core.parsing.antlr.spi.H2ShardingParseEngine
sharding-core/sharding-core-parser/sharding-core-parser-spi/pom.xml
0 → 100644
浏览文件 @
b7e01921
<?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"
>
<parent>
<artifactId>
sharding-core-parser
</artifactId>
<groupId>
org.apache.shardingsphere
</groupId>
<version>
4.0.0-RC2-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
sharding-core-parser-spi
</artifactId>
<name>
${project.artifactId}
</name>
</project>
sharding-core/sharding-core-parser/sharding-core-parser-
common/src/main/java/org/apache/shardingsphere/core/parsing/antlr/parser/impl
/SQLParser.java
→
sharding-core/sharding-core-parser/sharding-core-parser-
spi/src/main/java/org/apache/shardingsphere/core/parsing/api
/SQLParser.java
浏览文件 @
b7e01921
...
...
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package
org.apache.shardingsphere.core.parsing.a
ntlr.parser.impl
;
package
org.apache.shardingsphere.core.parsing.a
pi
;
import
org.antlr.v4.runtime.ParserRuleContext
;
...
...
sharding-core/sharding-core-parser/sharding-core-parser-spi/src/main/java/org/apache/shardingsphere/core/parsing/spi/ShardingParseEngine.java
0 → 100644
浏览文件 @
b7e01921
/*
* 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.shardingsphere.core.parsing.spi
;
import
org.apache.shardingsphere.core.parsing.api.SQLParser
;
/**
* Sharding parse engine.
*
* @author zhangliang
*/
public
interface
ShardingParseEngine
{
/**
* Get database type.
*
* @return database type
*/
String
getDatabaseType
();
/**
* Create SQL parser.
*
* @param sql SQL
* @return instance of SQL parser
*/
SQLParser
createSQLParser
(
String
sql
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录