ClickHouse / clickhouse-js

Official JS client for ClickHouse DB
https://clickhouse.com
Apache License 2.0
205 stars 25 forks source link

TypeError: Cannot read properties of undefined (reading 'trim') #219

Closed ReginYuan closed 5 months ago

ReginYuan commented 8 months ago

@clickhouse\client-common\dist\client.js:137:19) 我在做删除指定删除数据库中的表的字段时报错:TypeError: Cannot read properties of undefined (reading 'trim')

Make sure to check documentation https://clickhouse.com/docs/en/ first. If the question is concise and probably has a short answer, asking it in community Slack is probably the fastest way to find the answer. For more complicated questions, consider asking them on StackOverflow with "clickhouse" tag https://stackoverflow.com/questions/tagged/clickhouse

If you still prefer GitHub issues, remove all this text and ask your question here.

微信图片_20231228172643 微信图片_20231228172651
alexey-milovidov commented 8 months ago

Also, this bot should move issues to another repository if appropriate.

slvrtrn commented 8 months ago

@ReginYuan, do you use the query method like it's shown in this example: https://github.com/ClickHouse/clickhouse-js/blob/main/examples/select_json_each_row.ts#L7-L10? (see the params passed as an object with query property). If you could provide a code snippet that causes the failure, that would be nice, too.

mshustov commented 7 months ago

@slvrtrn maybe we should add a simple runtime validation for required fields? Not everyone uses typescript.

slvrtrn commented 7 months ago

@mshustov, I'd argue that 1) even in vanilla JS, code editors such as VS Code give type hints since those are embedded in the package:

image

2) if you click on the query method and then to QueryParams, all the types are still there to explore

image

3) API is thoroughly covered in the docs

4) Finally, TS should be considered; it's 2024 already.