Skip to content

Default validate output strips crucial error info #49

@rkistner

Description

@rkistner

Default output:

./node_modules/.bin/powersync validate --validate-only=sync-config              
Running validation tests...
✓ Validate Configuration Schema
  • [warning] Test skipped based on input flags.
✓ Test Connections
  • [warning] Test skipped based on input flags.
✗ Validate Sync Config
  • config:
  [error] 1:1 This table could not be found in the source schema., This table could not be found in the source schema., This table could not be found in the source schema., This table could not be found in the source schema., This table could not be found in the source schema., This table could not be found in the source schema., Syntax error at line 1 col 66:

Some validation tests failed.

YAML output:

# ./node_modules/.bin/powersync validate --validate-only=sync-config --output=yaml
passed: false
tests:
  - id: configuration
    name: Validate Configuration Schema
    passed: true
    warnings:
      - Test skipped based on input flags.
  - id: connections
    name: Test Connections
    passed: true
    warnings:
      - Test skipped based on input flags.
  - id: sync-config
    name: Validate Sync Config
    diagnostics:
      - endColumn: 1
        endLine: 1
        level: fatal
        message: >-
          This table could not be found in the source schema., This table could
          not be found in the source schema., This table could not be found in
          the source schema., This table could not be found in the source
          schema., This table could not be found in the source schema., This
          table could not be found in the source schema., Syntax error at line 1
          col 66:


          1  SELECT id, channel_id, channel_name, day, conversation_markdown,
          FROM slack_channel_conversations_by_day WHERE conversation_markdown IS
          NOT NULL
                                                                              ^
          Unexpected kw_from token: "from". Instead, I was expecting to see one
          of the following:

              - A "star" token
              - A "lparen" token
              - A "kw_not" token
              - A "word" token
              - A "op_plus" token
              - A "op_minus" token
              - A "kw_cast" token
              - A "kw_current_schema" token
              - A "kw_current_schema" token
              - A "kw_true" token
              - A "kw_false" token
              - A "kw_null" token
              - A "qparam" token
              - A "kw_default" token
              - A "word" token
              - A "word" token
              - A "word" token
              - A "word" token
              - A "kw_precision" token
              - A "kw_array" token
              - A "kw_array" token
              - A "kw_case" token
              - A "kw_primary" token
              - A "kw_unique" token
              - A "quoted_word" token
              - A "word" token
              - A "float" token
              - A "int" token
              - A "kw_current_catalog" token
              - A "kw_current_date" token
              - A "kw_current_role" token
              - A "kw_current_schema" token
              - A "kw_current_timestamp" token
              - A "kw_current_time" token
              - A "kw_localtimestamp" token
              - A "kw_localtime" token
              - A "kw_session_user" token
              - A "kw_user" token
              - A "kw_current_user" token
              - A "string" token
              - A "eString" token
              - A "kw_any" token
              - A "kw_some" token
              - A "kw_all" token

          , This table could not be found in the source schema.
        startColumn: 1
        startLine: 1
    errors:
      - >-
        config:

        1:1 This table could not be found in the source schema., This table
        could not be found in the source schema., This table could not be found
        in the source schema., This table could not be found in the source
        schema., This table could not be found in the source schema., This table
        could not be found in the source schema., Syntax error at line 1 col 66:


        1  SELECT id, channel_id, channel_name, day, conversation_markdown, FROM
        slack_channel_conversations_by_day WHERE conversation_markdown IS NOT
        NULL
                                                                            ^
        Unexpected kw_from token: "from". Instead, I was expecting to see one of
        the following:

            - A "star" token
            - A "lparen" token
            - A "kw_not" token
            - A "word" token
            - A "op_plus" token
            - A "op_minus" token
            - A "kw_cast" token
            - A "kw_current_schema" token
            - A "kw_current_schema" token
            - A "kw_true" token
            - A "kw_false" token
            - A "kw_null" token
            - A "qparam" token
            - A "kw_default" token
            - A "word" token
            - A "word" token
            - A "word" token
            - A "word" token
            - A "kw_precision" token
            - A "kw_array" token
            - A "kw_array" token
            - A "kw_case" token
            - A "kw_primary" token
            - A "kw_unique" token
            - A "quoted_word" token
            - A "word" token
            - A "float" token
            - A "int" token
            - A "kw_current_catalog" token
            - A "kw_current_date" token
            - A "kw_current_role" token
            - A "kw_current_schema" token
            - A "kw_current_timestamp" token
            - A "kw_current_time" token
            - A "kw_localtimestamp" token
            - A "kw_localtime" token
            - A "kw_session_user" token
            - A "kw_user" token
            - A "kw_current_user" token
            - A "string" token
            - A "eString" token
            - A "kw_any" token
            - A "kw_some" token
            - A "kw_all" token

        , This table could not be found in the source schema.
    passed: false
    prettyOutput: "\e[90m  • config:\e[39m

      \  \e[31m[error]\e[39m \e[31m1:1\e[39m This table could not be found in
      the source schema., This table could not be found in the source schema.,
      This table could not be found in the source schema., This table could not
      be found in the source schema., This table could not be found in the
      source schema., This table could not be found in the source schema.,
      Syntax error at line 1 col 66:"

For a start, outputting the full error output instead of "prettyOutput" would help.

It would help further if the output could include the position within the source YAML, rather than just the SQL queries - I'm not sure if this is a limitation in the service API? We do get the full position in the inline validations on the dashboard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions