-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI: Collections support #839
Conversation
Maybe |
The API is very strongly built around JSON at the moment - all values are assume to JSON. That's probably fine, but shouldn't we also be able to handle non-json values? I think so? We do say the collection stores string values. It's probably reasonable to try and parse all value as JSON, and if they fail, just return the verbatim value. |
Hmmm, for non-json values(binary data like images, ...) it would be a bit tricky to just encode them and store in the same place. |
I personally side with returning nothing when nothing is specified. give exactly the data they asked for. so if they asked for nothing, we give nothing. |
No unit tests becuase we don't have mock support yet
@doc-han Well 90% of our use-cases are going to be JSON based. I'm not sure why anyone would be saving binary data on our system - I'm not even sure why you'd store an arbitrary string really. I might raise a Meanwhile I also ought to add a catch for when JSON parsing fails, and we'll fallback to the raw value (perhaps with a warning) Regarding the key thing, I'll leave it as it is now: a required field Thanks for the input! |
Short Description
Adds collections support to the CLI
Closes #819
Docs are in OpenFn/docs#613
Usage Examples
Note: escaping
*
in the CLI is super important!Implementation Details
The most important things to note are these:
--token
with a different PAT--items
flag. It's a little cumbersome but designed, believe it or not, to reduce confusion.[{ key, value }]
format used on the wire)--page-size
), unless--limit
is passedTODO
created-since
etc flagsOther commands like
keys
andcount
will be implemented much later, when we have support form the backendAI Usage
Please disclose how you've used AI in this work (it's cool, we just want to know!):
You can read more details in our Responsible AI Policy