Closed bzon closed 5 years ago
Hi, the reason is that golang standard sql does not support slices in arguments. It does not know how to transform it into sql.Driver.Value. So, what you need, is to customize the ValueConverter in the Sqlmock, it can be provided as an option and customized using this
though, if clickhouse exposes that slice value converter as public, you could just use it, otherwise you may need to copy it. Every value in sql is either converted with ValueConverter
or read from Rows with Scanner interface. So probably you need to read about these to understand how to manage it.
@l3pp4rd I see. That is good to know. 🤔I will check it out. This is the package I'm using https://github.com/kshvakov/clickhouse.
I'm closing this issue now. I've decided to write an integration test instead of a unit test for my SQL code. Hopefully, Go's stdlib can be better.
Help needed
Please see the example code and the error message at the bottom. I'm not sure what is causing the error. My insert function works fine. I'm using this code to insert to a clickhouse database table.
Insert function:
Test function:
Error: