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

Invalid query generated in 1.0.1 #2383

Open
EequalsMCsquare opened this issue Oct 6, 2024 · 0 comments
Open

Invalid query generated in 1.0.1 #2383

EequalsMCsquare opened this issue Oct 6, 2024 · 0 comments

Comments

@EequalsMCsquare
Copy link

EequalsMCsquare commented Oct 6, 2024

Description

struct VehicleVerify {
    ...
    pub service_kinds: Vec<ServiceKind>, // ServiceKind is a enum defined in the database
}

in 0.12.15, the query builder output is: CAST("vehicle_verify"."service_kinds" AS text[]) AS "B_service_kinds". However in 1.0.1 it outputs: CAST("vehicle_verify"."service_kinds" AS "text[]") AS "B_service_kinds" notice the "text[]"

Steps to Reproduce

  1. Create enum type in PG
  2. Use it in a table
  3. Generate the schema using sea-orm-cli
  4. call Entity::select().all()

Expected Behavior

Returning all the records

Actual Behavior

Got an error: DbErr=Query(SqlxError(Database(PgDatabaseError { severity: Error, code: "42704", message: "type \"text[]\" does not exist", detail: None, hint: None, position: Some(Original(819)), where: None, schema: None, table: None, column: None, data_type: None, constraint: None, file: Some("parse_type.c"), line: Some(270), routine: Some("typenameType") })))

Reproduces How Often

Always

Workarounds

go back to 0.12.15 or write raw sql, I think

Reproducible Example

#2384

Versions

reco@192 services % cargo tree | grep sea-
│   │   │   │   │   ├── sea-orm v1.0.1
│   │   │   │   │   │   ├── sea-orm-macros v1.0.1 (proc-macro)
│   │   │   │   │   │   │   ├── sea-bae v0.2.0 (proc-macro)
│   │   │   │   │   │   ├── sea-query v0.31.1
│   │   │   │   │   │   ├── sea-query-binder v0.6.0
│   │   │   │   │   │   │   ├── sea-query v0.31.1 (*)
│   │   │   │   │   ├── sea-orm v1.0.1 (*)
│   │   │   │   ├── sea-orm v1.0.1 (*)
│   │   │   │       ├── sea-orm v1.0.1 (*)
│   │   │   ├── sea-orm v1.0.1 (*)
│   │   │   ├── sea-orm v1.0.1 (*)
│   │   ├── sea-orm v1.0.1 (*)

uname -a
Darwin 192.168.0.108 24.0.0 Darwin Kernel Version 24.0.0: Mon Aug 12 20:52:12 PDT 2024; root:xnu-11215.1.10~2/RELEASE_ARM64_T6020 arm64
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

No branches or pull requests

1 participant