squawk
squawk copied to clipboard
Display row counts, table size, etc in output messages
Related to #116
We could accept an input file that would include table name, row count, index size, table size, etc. and use that information to display more useful error messages.
If a migration is going to lock a table while it scans the whole table, that doesn't matter for a 300 row table, but does for a 3,000,000 row table.
Are rules that require access to a database welcome in squawk?
That said, the database instance which migrations are developed against is usually not biggest database that it will be run against. And locking a million-row table that gets no queries may be ok, but locking a thousand-row table that gets queried constantly could be bad.
Printing warnings based on the size of tables in a development environment may be misleading.
@jelder We don't have any rules that connect to the database, but I'm definitely open to ideas for rules that require more database information
I think my original idea for this issue was that you'd run some SQL on your production database, then Squawk would use that information for linting
@chdsbd One thing I'd like to have is a warning that a foreign key constraint isn't indexed.
Edit: Moved to #334