PNixx / clickhouse-activerecord

A Ruby database ActiveRecord driver for ClickHouse
MIT License
198 stars 100 forks source link

Add support for binary string #116

Closed PauloMiranda98 closed 8 months ago

PauloMiranda98 commented 8 months ago

This PR aims to add support for binary string. The main problem is that the 'JSONCompact' format removes invalid UTF-8 bytes. To fix this I needed to change the format to some 'EachRow' version. I chose 'JSONCompactEachRowWithNamesAndTypes'.

Any suggestions are welcome.

Documentation Sugestion: "Use the JSONEachRow format if you are sure that the data in the table can be formatted as JSON without losing any information."

Reference: https://clickhouse.com/docs/en/interfaces/formats#json-selecting-data Issues: https://github.com/PNixx/clickhouse-activerecord/issues/57

PNixx commented 8 months ago

@PauloMiranda98 I added new test for support JSONCompact. We need to support parsing the previous format.

PauloMiranda98 commented 8 months ago

@PNixx What do you think https://github.com/PNixx/clickhouse-activerecord/pull/116/commits/5ae00a72ad6c68c49b0a9a3d20d0041c2375e691? Is it ok?