jreyesr / steampipe-plugin-postgres

A Steampipe plugin that provides access to data stored in plain Postgres servers
Apache License 2.0
6 stars 2 forks source link

Initial suggestions for plugin release #3

Open madhushreeray30 opened 9 months ago

madhushreeray30 commented 9 months ago

Thanks @jreyesr for this new plugin. Great work 🎉 !!

The basic structure looks good so far. While using the plugin, we did come up with a few suggestions based on our best practices:

postgres.spc

docs/tables

docs/index.md

README

go.mod

Please let us know if you have questions, happy to help 👍

jreyesr commented 9 months ago

Hello @madhushreeray30, and thanks for all the suggestions!

I've implemented most of them in https://github.com/jreyesr/steampipe-plugin-postgres/commit/ff39b1f20232a99e3618d89fa61197e0143788da. The only points that require a standalone comment, I think, are:

Is the environment variable name correct?

I think so. Unlike, say, the AWS CLI (where you know that you must set, for example, AWS_DEFAULT_REGION, because that's what Amazon's official CLI uses), for this plugin there's not a clear reference CLI tool. Thus, there's no One True envvar that I must match, so I used DATABASE_URL

We generally do not include the example query output in the docs, is there a particular reason for keeping them here?

Not really, I've deleted them. Thanks!

plugin.go The function has some extra unnecessary spaces we can restructure it as follows

The original spacing came from gofmt, I think it tries to align the values and thus inserts spaces. I've changed it, but my IDE fought me (it really tries to autoformat on save) :)

How are we handling the resource not found errors?

Those would return zero results, as it would happen if you ran the same query in the remote (backing) DB. This plugin doesn't call a REST API, so there are no 404 errors. The worst that can happen is that you make a query that matches no records, in which case we just return zero records (i.e. an empty table)

Do the APIs support pagination? I did not find any reference to it, but I want to make sure that we have checked that box before releasing it.

No, there's no API behind this plugin, hence no pagination support. I can't push down LIMITs either, since that's not exposed by the Steampipe SDK.

While working with the APIs did you encounter rate limit errors?

There shouldn't be any, as the remote (backing) Postgres datastore shouldn't have rate limits in place. Postgres doesn't support those kinds of limits either.

Let me know if I've forgotten any suggestions. Again, thanks for the review!

madhushreeray30 commented 8 months ago

Hey @jreyesr thanks for making the changes 👍. While going through the fixes here are few more suggestions that you can work on

jreyesr commented 8 months ago

All done! (see https://github.com/jreyesr/steampipe-plugin-postgres/commit/c5efa4dc9877117558d1569d5caff6a02f866693)

madhushreeray30 commented 8 months ago

@jreyesr Thanks, the changes look good to me 👍 . Will let you know if any further changes ar required.

jreyesr commented 6 months ago

Hello there @madhushreeray30! Just wanted to check in to see if there are any more changes that I should make to the plugin, I've kinda forgotten to follow up on this.

Thanks for your help!