Skip to content

[QUESTION] Using chproxy with clickhouse-client with NodeJS #485

@asif-git-hub

Description

@asif-git-hub

Which feature your question relates to?
Using chproxy in a NodeJS application to run queries

Question details
I am looking for examples on using chproxy in my nodeJS application.

I am having trouble trying to query our clickhouse table via chproxy from a nodeJS (TS) server-side application:
This is how I form the client which passes the health check when I call .ping()

  client = createClient({
    url: getEnvVar("DB_URL"),
    pathname: "play",
    username: getEnvVar("DB_USERNAME"),
    password: getEnvVar("DB_PASSWORD"),
  }) 

When I try to query a table I always keep getting this error:
select * from DATABASE.TABLE LIMIT 2;

Error: There is no handle /play?query_id=c152ca33-ac4d-4288-810e-2577b45c9bfc

Use / or /ping for health checks.
Or /replicas_status for more sophisticated health checks.

Additional context/motivations
"@clickhouse/client": "^1.8.1",
The clickhouse version we are running is 24.3.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions