Skip to content

Commit

Permalink
Add support for connection key columns (#740)
Browse files Browse the repository at this point in the history
Co-authored-by: ParthaI <[email protected]>
  • Loading branch information
bigdatasourav and ParthaI authored Apr 23, 2024
1 parent a330c2d commit 66f8840
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions azure/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ func Plugin(ctx context.Context) *plugin.Plugin {
DefaultIgnoreConfig: &plugin.IgnoreConfig{
ShouldIgnoreErrorFunc: shouldIgnoreErrorPluginDefault(),
},
ConnectionKeyColumns: []plugin.ConnectionKeyColumn{
{
Name: "subscription_id",
Hydrate: getSubscriptionIdForConnection,
},
},
ConnectionConfigSchema: &plugin.ConnectionConfigSchema{
NewInstance: ConfigInstance,
},
Expand Down Expand Up @@ -189,3 +195,12 @@ func Plugin(ctx context.Context) *plugin.Plugin {

return p
}

func getSubscriptionIdForConnection(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (any, error) {
subscriptionID, err := getSubscriptionID(ctx, d, h)
if err != nil {
return nil, err
}

return subscriptionID, nil
}

0 comments on commit 66f8840

Please sign in to comment.