SQL Parser
Background
Spring namespace’s SQL parser configuration applies to traditional Spring projects. SQL parsing rules and attributes can be configured through the XML configuration files of the namespace.
Parameters
Namespace:http://shardingsphere.apache.org/schema/shardingsphere/sql-parser/sql-parser-5.2.1.xsd
<sql-parser:rule />
Name | Type | Description |
---|---|---|
id | Attribute | Spring Bean Id |
sql-comment-parse-enable | Attribute | Whether to parse SQL comments |
parse-tree-cache-ref | Attribute | Parse tree local cache name |
sql-statement-cache-ref | Attribute | SQL statement local cache name |
<sql-parser:cache-option />
Name | Type | Description |
---|---|---|
id | Attribute | Local cache configuration item name |
initial-capacity | Attribute | Initial capacity of local cache |
maximum-size | Attribute | Maximum capacity of local cache |
Procedure
- Set local cache configuration.
- Set parser configuration.
- Parse SQL with a parsing engine.
Sample
<sql-parser:rule id="sqlParseRule" sql-comment-parse-enable="true" parse-tree-cache-ref="parseTreeCache" sql-statement-cache-ref="sqlStatementCache" />
<sql-parser:cache-option id="sqlStatementCache" initial-capacity="1024" maximum-size="1024"/>
<sql-parser:cache-option id="parseTreeCache" initial-capacity="1024" maximum-size="1024"/>
Related References
当前内容版权归 ShardingSphere 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 ShardingSphere .