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

Thanks smeatonj for the report.