github.com/turbot/steampipe-plugin-sdk v0.3.0-rc.0.0.20210618102921-1cc4077273a6
func tableStripeProduct(ctx context.Context) *plugin.Table {
return &plugin.Table{
Name: "stripe_product",
Description: "Products available for purchase or subscription.",
List: &plugin.ListConfig{
Hydrate: listProduct,
OptionalKeyColumns: plugin.AnyColumn([]string{"active", "id", "shippable", "url"}),
},
Columns: []*plugin.Column{
// Top columns
{Name: "id", Type: proto.ColumnType_STRING, Description: "Unique identifier for the product."},
{Name: "name", Type: proto.ColumnType_STRING, Description: "The product’s full name or business name."},
{Name: "type", Type: proto.ColumnType_STRING, Description: "The product type."},
{Name: "unit_label", Type: proto.ColumnType_STRING, Description: "A label that represents units of this product in Stripe and on customers’ receipts and invoices. When set, this will be included in associated invoice line item descriptions."},
// Other columns
{Name: "active", Type: proto.ColumnType_BOOL, Description: "Whether the product is currently available for purchase."},
{Name: "created", Type: proto.ColumnType_TIMESTAMP, Transform: transform.FromField("Created").Transform(transform.UnixToTimestamp), Description: "Time at which the product was created."},
{Name: "description", Type: proto.ColumnType_STRING, Description: "An arbitrary string attached to the product. Often useful for displaying to users."},
{Name: "images", Type: proto.ColumnType_JSON, Description: "A list of up to 8 URLs of images for this product, meant to be displayable to the customer."},
{Name: "livemode", Type: proto.ColumnType_BOOL, Description: "Has the value true if the product exists in live mode or the value false if the product exists in test mode."},
{Name: "metadata", Type: proto.ColumnType_JSON, Description: "Set of key-value pairs that you can attach to an product. This can be useful for storing additional information about the product in a structured format."},
{Name: "package_dimensions", Type: proto.ColumnType_JSON, Description: "The dimensions of this product for shipping purposes."},
{Name: "shippable", Type: proto.ColumnType_BOOL, Description: "Whether this product is shipped (i.e., physical goods)."},
{Name: "statement_descriptor", Type: proto.ColumnType_STRING, Description: "Extra information about a product which will appear on your customer’s credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used."},
{Name: "updated", Type: proto.ColumnType_TIMESTAMP, Transform: transform.FromField("Updated").Transform(transform.UnixToTimestamp), Description: "Time at which the product was updated."},
{Name: "url", Type: proto.ColumnType_STRING, Description: "A URL of a publicly-accessible webpage for this product."},
},
}
}
2021-06-18 17:42:09.994 EDT [51228] LOG: statement: select * from stripe_product where active = true
2021/06/18 15:42:10 [INFO]
******************************************************
steampipe postgres fdw init
******************************************************
2021/06/18 15:42:10 [INFO] Log level info
2021-06-18T15:42:10.016-0600 [INFO] hub: query cache created
2021-06-18T15:42:10.036-0600 [INFO] hub: GetPathKeys for connection 'stripe`, table `stripe_product` returning [{[active] 10} {[active id] 1} {[active name] 1} {[active type] 1} {[active unit_label] 1} {[active created] 1} {[active description] 1} {[active images] 1} {[active livemode] 1} {[active metadata] 1} {[active package_dimensions] 1} {[active shippable] 1} {[active statement_descriptor] 1} {[active updated] 1} {[active url] 1} {[id] 10} {[id name] 1} {[id type] 1} {[id unit_label] 1} {[id active] 1} {[id created] 1} {[id description] 1} {[id images] 1} {[id livemode] 1} {[id metadata] 1} {[id package_dimensions] 1} {[id shippable] 1} {[id statement_descriptor] 1} {[id updated] 1} {[id url] 1} {[shippable] 10} {[shippable id] 1} {[shippable name] 1} {[shippable type] 1} {[shippable unit_label] 1} {[shippable active] 1} {[shippable created] 1} {[shippable description] 1} {[shippable images] 1} {[shippable livemode] 1} {[shippable metadata] 1} {[shippable package_dimensions] 1} {[shippable statement_descriptor] 1} {[shippable updated] 1} {[shippable url] 1} {[url] 10} {[url id] 1} {[url name] 1} {[url type] 1} {[url unit_label] 1} {[url active] 1} {[url created] 1} {[url description] 1} {[url images] 1} {[url livemode] 1} {[url metadata] 1} {[url package_dimensions] 1} {[url shippable] 1} {[url statement_descriptor] 1} {[url updated] 1}]
2021-06-18T15:42:10.037-0600 [INFO] hub: goFdwBeginForeignScan, connection 'stripe', table 'stripe_product'
2021-06-18T15:42:10.037-0600 [INFO] hub: RestrictionsToQuals: converted postgres restrictions protobuf quals
2021-06-18T15:42:10.037-0600 [INFO] hub: executing query for connection stripe, caching ENABLED with TTL 300 seconds
2021-06-18T15:42:10.037-0600 [INFO] hub: connection 'stripe', table 'stripe_product', quals
----------------------------------------------------------------
Column: active, Operator: '=', Value: 'true'
----------------------------------------------------------------
2021-06-18T15:42:10.037-0600 [INFO] hub: CACHE MISS - no index
2021-06-18T15:42:10.037-0600 [INFO] hub: StartScan
table: stripe_product
columns: [id name type unit_label active created description images livemode metadata package_dimensions shippable statement_descriptor updated url]
2021-06-18T15:42:10.038-0600 [INFO] plugin.steampipe-plugin-stripe.plugin: [INFO] list quals - this is list call, list quals: map[], optional list quals: map[active:bool_value:true]
2021-06-18T15:42:10.049-0600 [WARN] plugin.steampipe-plugin-stripe.plugin: [WARN] stripe_customer.listProduct: q=map[active:bool_value:true]
2021-06-18T15:42:10.049-0600 [WARN] plugin.steampipe-plugin-stripe.plugin: [WARN] stripe_customer.listProduct: params="&{{context.Background.WithValue(type context_key.contextKey, val <not Stringer>) <nil> [] {[]} 0xc00032a040 false <nil> <nil>} 0xc00032a048 <nil> <nil> [] <nil> <nil> <nil>}"
2021-06-18T15:42:10.632-0600 [INFO] hub: scan complete
2021-06-18T15:42:10.632-0600 [INFO] hub: adding 12 rows to cache
2021-06-18 17:42:10.633 EDT [51228] LOG: statement: COMMIT
2021-06-18 17:41:52.020 EDT [51203] LOG: statement: select * from stripe_product where active = false
2021/06/18 15:41:52 [INFO]
******************************************************
steampipe postgres fdw init
******************************************************
2021/06/18 15:41:52 [INFO] Log level info
2021-06-18T15:41:52.052-0600 [INFO] hub: query cache created
2021-06-18T15:41:52.075-0600 [INFO] hub: GetPathKeys for connection 'stripe`, table `stripe_product` returning [{[active] 10} {[active id] 1} {[active name] 1} {[active type] 1} {[active unit_label] 1} {[active created] 1} {[active description] 1} {[active images] 1} {[active livemode] 1} {[active metadata] 1} {[active package_dimensions] 1} {[active shippable] 1} {[active statement_descriptor] 1} {[active updated] 1} {[active url] 1} {[id] 10} {[id name] 1} {[id type] 1} {[id unit_label] 1} {[id active] 1} {[id created] 1} {[id description] 1} {[id images] 1} {[id livemode] 1} {[id metadata] 1} {[id package_dimensions] 1} {[id shippable] 1} {[id statement_descriptor] 1} {[id updated] 1} {[id url] 1} {[shippable] 10} {[shippable id] 1} {[shippable name] 1} {[shippable type] 1} {[shippable unit_label] 1} {[shippable active] 1} {[shippable created] 1} {[shippable description] 1} {[shippable images] 1} {[shippable livemode] 1} {[shippable metadata] 1} {[shippable package_dimensions] 1} {[shippable statement_descriptor] 1} {[shippable updated] 1} {[shippable url] 1} {[url] 10} {[url id] 1} {[url name] 1} {[url type] 1} {[url unit_label] 1} {[url active] 1} {[url created] 1} {[url description] 1} {[url images] 1} {[url livemode] 1} {[url metadata] 1} {[url package_dimensions] 1} {[url shippable] 1} {[url statement_descriptor] 1} {[url updated] 1}]
2021-06-18T15:41:52.076-0600 [INFO] hub: goFdwBeginForeignScan, connection 'stripe', table 'stripe_product'
2021-06-18T15:41:52.076-0600 [INFO] hub: RestrictionsToQuals: converted postgres restrictions protobuf quals
2021-06-18T15:41:52.076-0600 [INFO] hub: executing query for connection stripe, caching ENABLED with TTL 300 seconds
2021-06-18T15:41:52.076-0600 [INFO] hub: no quals
2021-06-18T15:41:52.076-0600 [INFO] hub: CACHE MISS - no index
2021-06-18T15:41:52.076-0600 [INFO] hub: StartScan
table: stripe_product
columns: [id name type unit_label active created description images livemode metadata package_dimensions shippable statement_descriptor updated url]
2021-06-18T15:41:52.076-0600 [INFO] plugin.steampipe-plugin-stripe.plugin: [INFO] table 'stripe_product': list call, with no list quals
2021-06-18T15:41:52.087-0600 [WARN] plugin.steampipe-plugin-stripe.plugin: [WARN] stripe_customer.listProduct: q=map[]
2021-06-18T15:41:52.087-0600 [WARN] plugin.steampipe-plugin-stripe.plugin: [WARN] stripe_customer.listProduct: params="&{{context.Background.WithValue(type context_key.contextKey, val <not Stringer>) <nil> [] {[]} 0xc00030c348 false <nil> <nil>} <nil> <nil> <nil> [] <nil> <nil> <nil>}"
2021-06-18T15:41:52.754-0600 [INFO] hub: scan complete
2021-06-18T15:41:52.754-0600 [INFO] hub: adding 13 rows to cache
2021-06-18 17:41:52.755 EDT [51203] LOG: statement: COMMIT