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

supabase / cli / 8665741536

12 Apr 2024 05:19PM UTC coverage: 57.738% (-0.07%) from 57.812%
8665741536

Pull #2138

github

sweatybridge
fix: add schema column to table sizes query
Pull Request #2138: fix: exclude supabase managed schemas from inspect subcommand

2 of 46 new or added lines in 20 files covered. (4.35%)

5 existing lines in 1 file now uncovered.

6376 of 11043 relevant lines covered (57.74%)

662.93 hits per line

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

0.0
/internal/inspect/replication_slots/replication_slots.go
1
package replication_slots
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/inspect"
12
        "github.com/supabase/cli/internal/migration/list"
13
        "github.com/supabase/cli/internal/utils"
14
        "github.com/supabase/cli/internal/utils/pgxv5"
15
)
16

17
type Result struct {
18
        Slot_name                  string
19
        Active                     bool
20
        State                      string
21
        Replication_client_address string
22
        Replication_lag_gb         string
23
}
24

25
func Run(ctx context.Context, config pgconn.Config, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error {
×
26
        conn, err := utils.ConnectByConfig(ctx, config, options...)
×
27
        if err != nil {
×
28
                return err
×
29
        }
×
NEW
30
        rows, err := conn.Query(ctx, inspect.REPLICATION_SLOTS_QUERY)
×
31
        if err != nil {
×
32
                return errors.Errorf("failed to query rows: %w", err)
×
33
        }
×
34
        result, err := pgxv5.CollectRows[Result](rows)
×
35
        if err != nil {
×
36
                return err
×
37
        }
×
38
        // TODO: implement a markdown table marshaller
39
        table := "|Name|Active|State|Replication Client Address|Replication Lag GB|\n|-|-|-|-|-|\n"
×
40
        for _, r := range result {
×
NEW
41
                table += fmt.Sprintf("|`%s`|`%t`|`%s`|`%s`|`%s`|\n", r.Slot_name, r.Active, r.State, r.Replication_client_address, r.Replication_lag_gb)
×
42
        }
×
43
        return list.RenderTable(table)
×
44
}
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