Skip to content

v3 doesnt support enum array #2818

Description

@DoctorFTB

Description and expected behavior
Enum array is not handled correctly
Its cannot be select/insert/update

enum TestTag {
  INFO @map("info")
  WARN @map("warn")

  @@map("post_tag")
}

model Test {
  id   String  @id @default(cuid())
  tags TestTag[]
}
    dbErrorMessage: 'malformed array literal: "info"',
    sql: 'select "Test"."id" as "id", case when "Test"."tags" = $1 then $2 when "Test"."tags" = $3 then $4 else cast("Test"."tags" as text) end as "tags" from "public"."Test" limit $5 ',
    sqlParams: [ 'info', 'INFO', 'warn', 'WARN', 1 ],
    reason: 'db-query-error',

Environment (please complete the following information):

  • ZenStack version: 3.9.2
  • Database type: PostgreSQL
  • Node.js/Bun version: 22
  • Package manager: npm

Additional context
Repro repo: https://github.com/DoctorFTB/zenstack-v3-enum-bug

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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