drizzle-team / drizzle-team/drizzle-orm
[DOCUMENTATION ISSUE] : Documentation for raw sql queries incredibly unclear
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
Hello Drizzle team,
Thought I would report this to you as a heads up as I spent some hours on this.
I am running drizzle 0.29.4 and drizzle kit 0.20.14 and using better-sqlite3 as the engine.
I was trying to execute a raw SQL query using "sql.raw()" and spent many hours trying to figure out how to actually execute it properly.
The doc states you can use "db.execute", however the db does not have that method available so after many hours of searching and trying different things to get my results I found the actual execution hidden away inside "goodies" where i was able to run "db.all()" on my query.
The current webpage for using "sql.raw()" is fine for actually building the string, the problem is the execution is not listed anywhere near the actual "magic sql operator" section.
To speed up getting into the ORM I would suggest you move the execution of sql raw into the actual "magic sql" section.
Docs around SQL raw: https://orm.drizzle.team/docs/sql
Doc where actual execution lives: https://orm.drizzle.team/docs/goodies#raw-sql-queries-execution
Cheers,
Ben
Contributor guide
Assessment
This issue has not been assessed yet.