Skip to content
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

Return Headers with CSV Formatter #337

Merged
merged 6 commits into from
Sep 1, 2024
Merged

Conversation

zack-carlson
Copy link
Contributor

The CSV Formatter could be used with Bulk Imports that will return more data than a single request can handle.

Rather that only including the $request->getBody() the interface allows for returning an array.

If this is not a viable option because of its potential to break other implementations that expect the I'm happy to create a new formatter

$data = Forrest::get(
                    "/services/data/v59.0/jobs/query/" . $bulkJob["id"] . "/results?locator=" . $locator_id . "",
                    [],
                    [
                        "format" => "csv",
                        "Accept" => "text/csv"
                    ]
                );
                
                // $data['header']['Sforce-Locator'] is set if the bulk job requires multiple requests to download results.

Thanks!

For Bulk Queries with CSVs that rely on chunking, users may need to return headers with the following values: 

'Sforce-Limit-Info' => 
'Sforce-Locator' => 
'Sforce-NumberOfRecords' => 

This proposed change would allow that.
@omniphx
Copy link
Owner

omniphx commented Mar 13, 2024

Hi @zack-carlson, since this would be a breaking change would you mind creating a new formatter for this? Maybe something called CsvFormatterWithHeaderes? In the next major version bump, I can deprecate it and combine them into a single formatter

@zack-carlson
Copy link
Contributor Author

Updated! Let me know.

@omniphx omniphx merged commit b8e4eb5 into omniphx:master Sep 1, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants