SQL Parser

Background

The configuration method of Spring Boot Starter is applicable to business scenarios using SpringBoot. In this way, the SpringBoot configuration initialization and bean management capabilities can be used to the greatest extent, so as to simplify code development.

Parameters

  1. spring.shardingsphere.rules.sql-parser.sql-comment-parse-enabled= # Whether to parse SQL comments
  2. spring.shardingsphere.rules.sql-parser.sql-statement-cache.initial-capacity= # Initial capacity of SQL statement local cache
  3. spring.shardingsphere.rules.sql-parser.sql-statement-cache.maximum-size= # Maximum capacity of SQL statement local cache
  4. spring.shardingsphere.rules.sql-parser.parse-tree-cache.initial-capacity= # Initial capacity of parse tree local cache
  5. spring.shardingsphere.rules.sql-parser.parse-tree-cache.maximum-size= # Maximum local cache capacity of parse tree

Procedure

  1. Set local cache configuration
  2. Set parser configuration
  3. use the parser engine to parse SQL

Sample

  1. spring.shardingsphere.rules.sql-parser.sql-comment-parse-enabled=true
  2. spring.shardingsphere.rules.sql-parser.sql-statement-cache.initial-capacity=2000
  3. spring.shardingsphere.rules.sql-parser.sql-statement-cache.maximum-size=65535
  4. spring.shardingsphere.rules.sql-parser.parse-tree-cache.initial-capacity=128
  5. spring.shardingsphere.rules.sql-parser.parse-tree-cache.maximum-size=1024