• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / cli / 8666347059

12 Apr 2024 06:20PM UTC coverage: 57.73%. First build
8666347059

Pull #2134

github

sweatybridge
chore: bold created project url
Pull Request #2134: Prod deploy

14 of 100 new or added lines in 25 files covered. (14.0%)

6378 of 11048 relevant lines covered (57.73%)

662.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/internal/inspect/bloat/bloat.go
1
package bloat
2

3
import (
4
        "context"
5
        "fmt"
6

7
        "github.com/go-errors/errors"
8
        "github.com/jackc/pgconn"
9
        "github.com/jackc/pgx/v4"
10
        "github.com/spf13/afero"
11
        "github.com/supabase/cli/internal/db/reset"
12
        "github.com/supabase/cli/internal/inspect"
13
        "github.com/supabase/cli/internal/migration/list"
14
        "github.com/supabase/cli/internal/utils"
15
        "github.com/supabase/cli/internal/utils/pgxv5"
16
)
17

18
type Result struct {
19
        Type        string
20
        Schemaname  string
21
        Object_name string
22
        Bloat       string
23
        Waste       string
24
}
25

26
func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error {
×
27
        conn, err := utils.ConnectByConfig(ctx, config, options...)
×
28
        if err != nil {
×
29
                return err
×
30
        }
×
NEW
31
        rows, err := conn.Query(ctx, inspect.BLOAT_QUERY, reset.LikeEscapeSchema(utils.InternalSchemas))
×
32
        if err != nil {
×
33
                return errors.Errorf("failed to query rows: %w", err)
×
34
        }
×
35
        result, err := pgxv5.CollectRows[Result](rows)
×
36
        if err != nil {
×
37
                return err
×
38
        }
×
39

40
        table := "|Type|Schema name|Object name|Bloat|Waste\n|-|-|-|-|-|\n"
×
41
        for _, r := range result {
×
42
                table += fmt.Sprintf("|`%s`|`%s`|`%s`|`%s`|`%s`|\n", r.Type, r.Schemaname, r.Object_name, r.Bloat, r.Waste)
×
43
        }
×
44
        return list.RenderTable(table)
×
45
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc