turbot / steampipe-plugin-sdk

Steampipe Plugin SDK is a simple abstraction layer to write a Steampipe plugin. Plugins automatically work across all engine types including the Steampipe CLI, Postgres FDW, SQLite extension and the export CLI.

Home Page:https://hub.steampipe.io/plugins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The original function names for Memoized hydrate calls are incorrectly resolved.

kaidaguerre opened this issue · comments

This usage is no longer supported:

Columns: awsGlobalRegionColumns([]*plugin.Column{
			{
				Name:        "account_aliases",
				Description: "A list of aliases associated with the account, if applicable.",
				Type:        proto.ColumnType_JSON,
				Transform:   transform.FromField("Aliases"),
				Hydrate: plugin.HydrateFunc(GetAccountAliases).Memoize()
			},

Instead the function to memoize must be wrapped in another hydrate:


func GetAccountAliasesUncached(ctx context.Context, d *QueryData, h *HydrateData) (interface{}, error){
	// do stuff
}

var GetAccountAliasesCached = HydrateFunc(GetAccountAliasesUncached).Memoize()

func GetAccountAliasesMemoized(ctx context.Context, d *QueryData, h *HydrateData) (interface{}, error){
   	return GetAccountAliasesCached(ctx, d, h)
}



Columns: awsGlobalRegionColumns([]*plugin.Column{
			{
				Name:        "account_aliases",
				Description: "A list of aliases associated with the account, if applicable.",
				Type:        proto.ColumnType_JSON,
				Transform:   transform.FromField("Aliases"),
				Hydrate: GetAccountAliases
			},