apache / shardingsphere

Distributed SQL transaction & query engine for data sharding, scaling, encryption, and more - on any database.
Apache License 2.0
19.84k stars 6.71k forks source link

Add the actual schema mapping to information_schema #22007

Open taojintianxia opened 1 year ago

taojintianxia commented 1 year ago

Hi, there

for some IDE or data transmation tool usage, it will read the data of tables in information_schema, and now the inforamtion_schema in ShardingSphere is an empty logical schema. please add a mapping from actual schema information_schema in MySQL.

currently we have following steps to resolve this situation :

use some_other_schema;

drop database information_schema;

create database information_schema;

use information_schema;

add resource ds_0 (
 URL="jdbc:mysql://datasource-1.test:3306/information_schema?serverTimezone=UTC&useSSL=false",
 user=TEST_USER,
 password=PASSWORD,
 PROPERTIES("maximumPoolSize"=50,"idleTimeout"="6000")
);

it will be better if this could be resolved from the ShardingSphere core

tuichenchuxin commented 1 year ago

Recently, shardingSphere have mocked information_schema's tables struct, but there's no data. I think it's better to collect data for information_schema, and save to zk node -> sys_data. But there's huge data that's need to be collected and decorated. Mapping to information_schema will not be a final solution. So whether to do this, we still need to discuss it together.

taojintianxia commented 1 year ago

all right, please let me know if there is a solution. thanks