Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display row counts, table size, etc in output messages #197

Open
chdsbd opened this issue Apr 5, 2022 · 3 comments
Open

Display row counts, table size, etc in output messages #197

chdsbd opened this issue Apr 5, 2022 · 3 comments

Comments

@chdsbd
Copy link
Collaborator

chdsbd commented Apr 5, 2022

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.

@jelder
Copy link

jelder commented Dec 11, 2023

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.

@chdsbd
Copy link
Collaborator Author

chdsbd commented Dec 12, 2023

@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

@jelder
Copy link

jelder commented Dec 22, 2023

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

Edit: Moved to #334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants