RaigorJiang opened a new issue #14807: URL: https://github.com/apache/shardingsphere/issues/14807
Hi community, starting from version 5.0.0, DistSQL provides many syntaxes to help users query resources and rule configuration, such as - SHOW SCHEMA RESOURCES - SHOW SHARDING TABLE RULES - SHOW SHARDING ALGORITHMS - SHOW READWRITE_SPLITTING RULES - ... However, if a user wants to obtain the complete configuration of a schema through DistSQL, it will be more difficult. On the other hand, there are users who want to define rules via DistSQL and export them as YAML. On the contrary, there are also users who want to convert the existing YAML files into DistSQL statements, so as to completely get rid of the constraints of configuration files. Therefore, I propose to design a series of new DistSQL syntax to help users achieve the above functions. Among them, the configuration export is a little easier, and we can start with this. ### Proposal For reference, I considered the following syntax: ```sql EXPORT SCHEMA (CONFIGURATION|CONFIG) [FROM schemaName] [, FILE="filePath"] ```` When the user inputs `EXPORT SCHEMA CONIFG`, print out all the resources and rule configurations in the schema (organized in YAML text format); When the user inputs `EXPORT SCHEMA CONIFG, file="/Users/foo/config-sharding.yaml"`, write the resources and rule configurations in the schema to the target YAML file. (The permission of Proxy to write files needs to be guaranteed by the user, otherwise an exception will be thrown) \ \ The above is just a preliminary idea, any suggestions are welcome. -- 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]
