using drush php-eval db_query() are there differences with db_query() from code? I think the answer should be easy but I can't find it.

maybe I've been put in the wrong direction finding sites telling how to clear my flood table like so:

drush php-eval 'db_query("DELETE FROM `flood`");'


But I think is should be like this so it also works for prefixed tables:

drush php-eval 'db_query("DELETE FROM `{flood}`");'


Or does db_query() works different in drush php-eval?
As far as I know it just executes php but does it has the drupal 'library' available or not?

Now I could just try and see what happens but I think it's good to really know if there's a difference or not in running db_query() from drush or from code.
I don't know this for definite but conceptually speaking, if Drush didn't use a standard Drupal bootstrap to perform these tasks it would have to re-implement all of that functionality itself.

Drush uses your site's settings.php file for the database connection, which leads me to believe it will also have access to things like $db_prefix.

I think it's safe to say exactly the same thing is happening when you run db_query() from Drush as if you run it from any other bootstrapped instance of Drupal.