Execute is not exist on a type LibSQLDatabase

const url = env.TURSO_DB_URL if (url === undefined) { throw new Error('TURSO_DB_URL is not defined'); } const authToken = env.TURSO_DB_AUTH_TOKEN if (authToken === undefined) { throw new Error('TURSO_DB_AUTH_TOKEN is not defined'); } const ab = await drizzle(createClient({ url, authToken })) c.set('db', ab.execute()) the type is LibSQLDatabase<Record<string,never>>
9 Replies
hugo
hugo16mo ago
I'm having the same issue. db.execute is undefined, maybe it's just not supported? Surprised the docs didn't mention it
Angelelz
Angelelz16mo ago
What is this line trying to achieve? c.set('db', ab.execute())
hugo
hugo16mo ago
IDK, I just wanted to try a raw sql query and I can’t when using libsql
Angelelz
Angelelz16mo ago
Well, you're executing an empty raw sql? You're calling execute with no query
hugo
hugo16mo ago
That’s not my code :). The issue is that execute method doesn’t exist
Angelelz
Angelelz16mo ago
Can you spin up a repro repo? I haven't seen this issue before
hugo
hugo16mo ago
No description
hugo
hugo16mo ago
import { createClient } from '@libsql/client'
import { drizzle } from 'drizzle-orm/libsql'

const db = drizzle(createClient({ url: String(process.env.DATABASE_URL) }))
import { createClient } from '@libsql/client'
import { drizzle } from 'drizzle-orm/libsql'

const db = drizzle(createClient({ url: String(process.env.DATABASE_URL) }))
hugo
hugo16mo ago
I believe it's just an issue on the docs here https://orm.drizzle.team/docs/sql#sql-template
Want results from more Discord servers?
Add your server