pjb3
pjb3
DTDrizzle Team
Created by pjb3 on 10/12/2023 in #help
ResolveMessage error when trying to run a query with drizzle postgres and bun
I have created a bun project with bun 1.0.6 and added drizzle-orm and postgres. I am trying to execute a basic query with this code:
import { sql } from "drizzle-orm"
import { drizzle } from "drizzle-orm/postgres-js"
import postgres from "postgres"

const client = postgres("postgres://localhost/my_db")
console.log("Created client")

const db = drizzle(client)
console.log("Created db")

const user = await db.execute(sql`select first_name from users where id = 1`)

console.log(`user: ${user}`)
import { sql } from "drizzle-orm"
import { drizzle } from "drizzle-orm/postgres-js"
import postgres from "postgres"

const client = postgres("postgres://localhost/my_db")
console.log("Created client")

const db = drizzle(client)
console.log("Created db")

const user = await db.execute(sql`select first_name from users where id = 1`)

console.log(`user: ${user}`)
But when I run it with bun run index.ts, I get this error:
Created client
Created db
error: ResolveMessage
Created client
Created db
error: ResolveMessage
Anyone know what might be wrong here?
13 replies