terrymanu opened a new issue, #31991: URL: https://github.com/apache/shardingsphere/issues/31991
In the current binder module design, ShardingSphere uses the `reflection` of SQLStatement to create a new SQLStatement object and sets the relevant metadata information. The main purpose is to `avoid incorrect values` in the SQLStatement `cache` object after the `metadata is modified by DDL`. In the current design, the `drawbacks` are: 1. Using reflection to reset SQLStatement leads to code duplication. 2. There is a risk of omitting properties that were forgotten to set. 3. It requires SQLStatement to provide a no-argument constructor, which affects the flexibility of the design. I would like to redesign it to put the SQLStatement after binding into the cache. This design can resolve the 3 drawbacks mentioned above, but at the same time, it introduces 2 new `challenges`: 1. After the metadata is modified, it is necessary to update the cached results after binding. 2. The same SQL for different databases needs to be distinguished. I hope to update the cache design by using the `database name + table name + update version + SQL` as the Key, and keep the Value as SQLStatement unchanged. -- 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]
