Is it safe to just use the pool directly?
Yes, as long as you are doing single statement queries. The only
reason you couldn’t use that in your example above is because you are
making multiple queries that need to be done in sequential order on
the same connection. Calling pool.query() may be different connections
each time, so things like FOUND_ROWS() will not work as you intended
if the connection is not the same as the one that did the
SQL_CALC_FOUND_ROWS query. Using the long method allows you to hold
onto the same connection for all your queries.
Does pool.query() release the connection back into the pool when it’s
done?
Yes