Fixed #22776 -- `sqlall` can now be used with a specific model.

The same goes for `sql`, `sqlcustom`, and `sqlindexes`.
Thanks smeatonj for the report.