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

cli: Add --output-format=PARTIQL_PRETTY for non-interactive use #349

Merged
merged 2 commits into from
Dec 24, 2020
Merged

cli: Add --output-format=PARTIQL_PRETTY for non-interactive use #349

merged 2 commits into from
Dec 24, 2020

Conversation

evanj
Copy link
Contributor

@evanj evanj commented Dec 24, 2020

Description of changes:

The interactive REPL prints PartiQL results in a "pretty" format with
newlines and indentation. The non-interactive command line tool does
not. This adds --output-format=PARTIQL_PRETTY to print results in the
same format.

Example result without --output-format:

<<{'employeeName': 'Bob Smith', 'projectName': 'AWS Redshift Spectrum querying'}, {'employeeName': 'Jane Smith', 'projectName': 'AWS Redshift security'}>>

Example result with --output-format=PARTIQL_PRETTY

<<
  {
    'employeeName': 'Bob Smith',
    'projectName': 'AWS Redshift Spectrum querying'
  },
  {
    'employeeName': 'Jane Smith',
    'projectName': 'AWS Redshift security'
  }
>>

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The interactive REPL prints PartiQL results in a "pretty" format with
newlines and indentation. The non-interactive command line tool does
not. This adds --output-format=PARTIQL_PRETTY to print results in the
same format.

Example result without --output-format:

    <<{'employeeName': 'Bob Smith', 'projectName': 'AWS Redshift Spectrum querying'}, {'employeeName': 'Jane Smith', 'projectName': 'AWS Redshift security'}>>

Example result with --output-format=PARTIQL_PRETTY

    <<
      {
        'employeeName': 'Bob Smith',
        'projectName': 'AWS Redshift Spectrum querying'
      },
      {
        'employeeName': 'Jane Smith',
        'projectName': 'AWS Redshift security'
      }
    >>
Copy link
Member

@alancai98 alancai98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for the contribution! For documentation purposes of the new output format, could you also add PARTIQL_PRETTY to

* * -of --output-format: output format, ION_TEXT, ION_BINARY and PARTIQL (default)

and to

(ION_TEXT|ION_BINARY|PARTIQL)>

Copy link
Member

@alancai98 alancai98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks again!

@alancai98 alancai98 merged commit 9175002 into partiql:master Dec 24, 2020
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