Skip to content

Doubt about when a query is executed. #2892

Closed Answered by t1u1
t1u1 asked this question in Q&A
Discussion options

You must be logged in to vote

ChatGPT to the rescue:

The query is executed automatically when you await the query object. This is because Drizzle ORM overrides the then() method of the query object, which is a part of the promise interface in JavaScript.
When you await a query, JavaScript internally calls the then() method of the query object, at which point Drizzle compiles the SQL statement and executes it against the database.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by t1u1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant