I've run into issues in the past due to a failure to completely iterate over the result from a query. The Mush documentation clearly states:
On that note, is it safe to break early if I also call db:interrupt()?
Also, do I need to iterate with a for loop for db:rows() if I'm only expecting a single row?
Do I need to do this:
Or can I just do this safely:
I can figure all of this out for myself but I can't tell how to check if the database is locked after setting up a piece of code.
What would be a good way to go about testing this?
Quote:
Note: You should let the iterator finish (that is, get to the end of the selected rows) otherwise the database remains locked. So, do not "break" out of the for loop.
Note: You should let the iterator finish (that is, get to the end of the selected rows) otherwise the database remains locked. So, do not "break" out of the for loop.
On that note, is it safe to break early if I also call db:interrupt()?
Also, do I need to iterate with a for loop for db:rows() if I'm only expecting a single row?
Do I need to do this:
local a;
for _ in db:rows(Statement) do
a = _
end -- forOr can I just do this safely:
local a;
a = db:rows(Statement)I can figure all of this out for myself but I can't tell how to check if the database is locked after setting up a piece of code.
What would be a good way to go about testing this?