Skip to content

Unstable__format bad handling of lists #5

Description

@Sceat

When using an array of maps the rebuilt query miss the [ ]

Query

UNWIND [{a:1},{b:2}] AS props

Result

UNWIND { a: 1 }{ b: 2 } AS props;

AST

{
  nnodes: 11,
  eof: true,
  errors: [],
  root: {
    type: 'statement',
    body: {
      type: 'query',
      clauses: [
        {
          type: 'unwind',
          expression: {
            type: 'collection',
            elements: [
              {
                type: 'map',
                entries: { a: { type: 'integer', value: 1 } }
              },
              {
                type: 'map',
                entries: { b: { type: 'integer', value: 2 } }
              }
            ]
          },
          alias: { type: 'identifier', name: 'props' }
        }
      ],
      options: []
    },
    options: []
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions