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

[@loopback/sequelize] Cannot use Loopback entity “array” property type with MySQL / MariaDB datasource #9629

Closed
KalleV opened this issue Jun 8, 2023 · 0 comments · Fixed by #10285

Comments

@KalleV
Copy link
Contributor

KalleV commented Jun 8, 2023

Describe the bug

If you try to save or update an entity with an “array” property, it will lead to a mysqld error for invalid data. This is caused by unserialized arrays being passed as parameters through the mysql2 driver.

Relates to: #9598

Logs

No response

Additional information

As a workaround, I tried changing the Loopback entity array properties to the “object” type but that causes a conflict with the Loopback request validation expecting an array type to be passed in the request.

Serializing arrays to a string for non-Postgres dialects at the Sequelize extension layer is likely the most straightforward way to resolve this.

References:

Reproduction

N/A

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

Successfully merging a pull request may close this issue.

2 participants