postgres icon indicating copy to clipboard operation
postgres copied to clipboard

TypeError: client.unsafe is not a function

Open mvolkmann opened this issue 1 year ago • 2 comments

This very simple demo of using Drizzle with PostgreSQL and Node gives me the error message in the title. Am I doing something wrong in this file? https://github.com/mvolkmann/drizzle-postgres-node/blob/main/src/db.mjs

mvolkmann avatar Jan 04 '24 22:01 mvolkmann

The file you referenced does not have any reference to unsafe at all, so I can't tell how are you using it. But I would guess the problem is exactly as the "error message" is saying. "unsafe" is not a function. unsafe is a string template. You don't do unsafe(...) instead you do unsafe`...`.

Louis-Tian avatar Jan 19 '24 02:01 Louis-Tian

@Louis-Tian You are correct that my code does not attempt to use unsafe. That is happening somewhere in the library code.

mvolkmann avatar Jan 19 '24 15:01 mvolkmann