PolyScale HTTP Proxy Client

The HTTP Proxy Client is used to talk to the PolyScale HTTP Proxy whiche enables usage of PolyScale caches in environments where a TCP database connection cannot be stablished, i.e. serverless functions on Cloudflare.

Install

npm install @polyscale/http

Usage

import Client from "@polyscale/http";

const polyscale = new Client("https://http.polyscale.global", {
    cacheId: "polyscale-cache-id",
    username: "target-db-username",
    password: "target-db-password",
    database: "target-db-database",
    provider: "mysql",
});

polyscale.query("SELECT 1;").then(result => console.log(result))