Open kwando opened 9 months ago
This is a big pain point for me as I'm using lucia auth which expects db.exec()
as a function. I'm having to implement a wrapper just for this one function and it'd be much better to have this as built-in
I also encountered this problem, will it be repaired in the near future?
In SQLite there's run
, values
, get
and all
methods available depending on what type of response you're expecting if any.
In SQLite there's
run
,values
,get
andall
methods available depending on what type of response you're expecting if any.
hey, @Angelelz
I'm not sure I understand what you mean, but as I understand it, Drizzle is supposed to be a wrapper around an ORM, which wipes out the differences between databases and makes it possible to implement the same syntax to achieve the same thing to a certain extent.
The problem described here is that when using SQLite, there is no way to execute SQL statements through drizzle. But my friend's test works in MySQL.
This is the error I encountered. The execute method is not implemented in the SQLite driver.
I found that the excute method is implemented in both MySQL and PostgreSQL, but not in SQLite
You can use db.run()
to run queries. db.get()
to run a query for which you only expect one result, db.all()
to run a query where you expect an array of rows.
Edit: and this is common among all the SQLite drivers.
Didn't think about testing db.all()
 and friends even though I'm also using the driver extensively 😅
I got confused since all the examples is using the db.execute
method :)
What version of
drizzle-orm
are you using?0.28.6
What version of
drizzle-kit
are you using?0.19.13
Describe the Bug
The
db.execute
method mentioned in the docs is not implemented, I would expect to find it heredrizzle-orm/drizzle-orm/src/sqlite-core/db.ts
https://orm.drizzle.team/docs/sqlExpected behavior
I would expect the
execute
method to be implemented or if it is not planned/possible at least mention it in the docs :)Environment & setup
No response