Skip to content

Commit

Permalink
fix: Handle NoConnection (#14115)
Browse files Browse the repository at this point in the history

#### Summary

Same as #14112 and #14102.

Required for the package command to work

<!--
  • Loading branch information
erezrokah committed Sep 28, 2023
1 parent 3f92704 commit d1497ac
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plugins/source/mysql/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ func (*Client) ID() string {
}

func Configure(ctx context.Context, logger zerolog.Logger, spec []byte, opts plugin.NewClientOptions) (plugin.Client, error) {
if opts.NoConnection {
return &Client{
logger: logger,
options: opts,
tables: schema.Tables{},
}, nil
}
var mySQLSpec Spec
err := json.Unmarshal(spec, &mySQLSpec)
if err != nil {
Expand Down Expand Up @@ -70,6 +77,9 @@ func Configure(ctx context.Context, logger zerolog.Logger, spec []byte, opts plu
}

func (c Client) Tables(ctx context.Context, opts plugin.TableOptions) (schema.Tables, error) {
if c.options.NoConnection {
return schema.Tables{}, nil
}
return c.tables.FilterDfs(opts.Tables, opts.SkipTables, opts.SkipDependentTables)
}

Expand Down

0 comments on commit d1497ac

Please sign in to comment.