squawk icon indicating copy to clipboard operation
squawk copied to clipboard

Display row counts, table size, etc in output messages

Open chdsbd opened this issue 2 years ago • 3 comments

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.

chdsbd avatar Apr 05 '22 21:04 chdsbd

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 avatar Dec 11 '23 13:12 jelder

@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 avatar Dec 12 '23 23:12 chdsbd

@chdsbd One thing I'd like to have is a warning that a foreign key constraint isn't indexed.

Edit: Moved to #334

jelder avatar Dec 22 '23 14:12 jelder