Skip to content

Uncaught error when retrieving columns info with jsonb[] with default values #72

@ntma

Description

@ntma

Hi knex-schema-inspector team,

Due to the nature of this regex, it seems that the default value of columns defined as json[] or jsonb[] will be parsed as Json objects and throw an uncaught error.

Reproduction

  • define a table with the following column;
   my_column jsonb[] default ARRAY[]::jsonb[],
  • retrieve information for the columns in our table;

In this case, the parsing will look like JSON.parse("ARRAY[]"), which is not a valid format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions