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
hugo15mo 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
Angelelz15mo ago
What is this line trying to achieve? c.set('db', ab.execute())
hugo
hugo15mo ago
IDK, I just wanted to try a raw sql query and I can’t when using libsql
Angelelz
Angelelz15mo ago
Well, you're executing an empty raw sql? You're calling execute with no query
hugo
hugo15mo ago
That’s not my code :). The issue is that execute method doesn’t exist
Angelelz
Angelelz15mo ago
Can you spin up a repro repo? I haven't seen this issue before
hugo
hugo15mo ago
No description
hugo
hugo15mo 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
hugo15mo 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