Effect CommunityEC
Effect Community13mo ago
6 replies
johtso

Trouble using PgClient with Cloudflare Hyperdrive connection string

I'm trying to use cloudflare hyperdrive with PgClient. It works fine if I use the postgres package directly, just passing it the connection url (const sql = postgres(env.HYPERDRIVE.connectionString)), but if I try to use PgClient with a config like this, it just hangs indefinitely. I'm guessing it's one of the default options causing problems? Any pointers?

  Effect.provide(PgClient.layer({
    url: Redacted.make(env.HYPERDRIVE.connectionString),
    transformQueryNames: String.camelToSnake,
    transformResultNames: String.snakeToCamel,
  }))
Was this page helpful?