Skip to content

Conversation

@encima
Copy link
Member

@encima encima commented Apr 10, 2024

What kind of change does this PR introduce?

Feature/Fix: moving queries for inspect to the root inspect module and removing Supabase schemas from queries

What is the current behavior?

Queries are within the command and show results from Supabase schemas that could cause concern or make the user take actions on schemas they do not own

What is the new behavior?

  • Queries moved into a single place (could be further developed to template similar queries)
  • Supabase schemas removed from relevant queries
  • Explanation of hit rates added to cache-hit command and a column explains whether action might be needed

Additional context

image

@encima encima requested a review from a team as a code owner April 10, 2024 07:50
@coveralls
Copy link

coveralls commented Apr 10, 2024

Pull Request Test Coverage Report for Build 8665741536

Details

  • 2 of 46 (4.35%) changed or added relevant lines in 20 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.07%) to 57.738%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/inspect/bloat/bloat.go 0 1 0.0%
internal/inspect/calls/calls.go 0 1 0.0%
internal/inspect/index_sizes/index_sizes.go 0 1 0.0%
internal/inspect/outliers/outliers.go 0 1 0.0%
internal/inspect/role_connections/role_connections.go 0 1 0.0%
internal/inspect/table_index_sizes/table_index_sizes.go 0 1 0.0%
internal/inspect/total_index_size/total_index_size.go 0 1 0.0%
internal/inspect/vacuum_stats/vacuum_stats.go 0 1 0.0%
internal/inspect/blocking/blocking.go 0 2 0.0%
internal/inspect/index_usage/index_usage.go 0 2 0.0%
Files with Coverage Reduction New Missed Lines %
internal/gen/keys/keys.go 5 11.76%
Totals Coverage Status
Change from base Build 8657336860: -0.07%
Covered Lines: 6376
Relevant Lines: 11043

💛 - Coveralls

@encima encima force-pushed the feat/inspect-suggest branch 2 times, most recently from 76428d5 to 867bc75 Compare April 10, 2024 12:07
@encima encima force-pushed the feat/inspect-suggest branch from 867bc75 to 931ee66 Compare April 10, 2024 12:08
@encima encima force-pushed the feat/inspect-suggest branch from 931ee66 to c3c4312 Compare April 10, 2024 12:12
@encima encima requested a review from sweatybridge April 10, 2024 12:17
Copy link
Contributor

@sweatybridge sweatybridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one more comment. Everything else looks good.

@encima encima requested a review from sweatybridge April 11, 2024 06:44
@sweatybridge sweatybridge changed the title Refine inspect subcommand fix: exclude supabase managed schemas from inspect subcommand Apr 12, 2024
@encima encima force-pushed the feat/inspect-suggest branch 2 times, most recently from 859216a to 03c5f18 Compare April 12, 2024 05:19
Copy link
Contributor

@sweatybridge sweatybridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've verified all commands locally and fixed the result types where appropriate.

A new change I made is to include managed schemas like auth, storage, extensions, etc. when inspecting table sizes, ie. table-records-count, table-sizes, total-table-sizes. Because records in these schemas are mostly inserted by the user, it would be a good idea to surface their sizes. Schemas with pg_* prefix and information_schema are still excluded from these queries.

In the future, we can perhaps move queries.go to individual *.sql files for better syntax checks.

@sweatybridge sweatybridge merged commit 82885ea into develop Apr 12, 2024
@sweatybridge sweatybridge deleted the feat/inspect-suggest branch April 12, 2024 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants