clickhouse-go icon indicating copy to clipboard operation
clickhouse-go copied to clipboard

How do I need to use map[string]interface in the project to correspond to the map[string]int/map[string]string type in the database

Open DGuang21 opened this issue 2 years ago • 3 comments

**Is your feature request related to an issue? Please describe. ** A clear and concise description of the problem. predecessor. when […]

I want to use map[string]interface in the project to correspond to the map[string]int/map[string]string type in the database

Describe your desired solution
A clear and concise description of what you want to happen.

Flexible, supports arbitrary conversion between int/uint/string types, you can use map[string] interface type scan/append row

Describe the alternatives you have considered A clear and concise description of any alternative solutions or features you've considered.

https://github.com/ClickHouse/clickhouse-go/pull/794, a small part has been completed, it seems that the code changes will not be too much, and already supports int/uint/string type conversion, as well as map[string ]interface select/insert

DGuang21 avatar Oct 25 '22 13:10 DGuang21

@DGuang21 a helpful example of what you want to be able to do, but currently can't, would be useful for reference. Took me a while to understand your need.

gingerwizard avatar Nov 21 '22 12:11 gingerwizard

@gingerwizard I'm sorry to cause you trouble, because I am a resident of a non -English country and my English may not be so good. I need to use translation software to communicate with you. There may be deviation in the translation process, but I may not know that there is a deviation.

But at present, this is a good start. I will start PR as soon as possible because the branch has lagged behind the main branch.

After the modification, I will remind you under the PR。

DGuang21 avatar Nov 21 '22 13:11 DGuang21

No problem @DGuang21 I think a simple test in code showing what you want to achieve would be enough. Keep the explanation minimal - we can share ideas over the common language of Go :)

gingerwizard avatar Nov 21 '22 14:11 gingerwizard