admin管理员组

文章数量:1123103

I currently have custom types on my RDS postgres database. We used them to keep things like states and types of different items. Our code has been developed using TS and the drizzle orm and has been deployed on AWS Lambdas. When querying using this custom types the RDS client does not automatically cast this custom types as a psql client would. We get the following error:

ERROR: operator does not exist: core_backend.recurrence_status = text; Hint: No operator matches the given name and argument types. You might need to add explicit type casts.

If I explicitly cast the value in the query using CAST(status AS core_backend.recurrence_status), it works. However, this approach negates the type safety benefits of Drizzle ORM and leads to more verbose code.

Is there a way to enable automatic casting for custom types either in the RDS client configuration or within Drizzle ORM to streamline these queries while preserving type safety?

本文标签: postgresqlCasting custom types with RDS data api and Aurora postgresStack Overflow