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

[FEATURE]: Add support for inserting and updating arrays in aws-data-api #1912

Closed
livingforjesus opened this issue Feb 21, 2024 · 0 comments · May be fixed by dennis-adrian/glitter-nextjs#87 or YuraGB/project_be#24
Labels
enhancement New feature or request

Comments

@livingforjesus
Copy link
Contributor

Describe what you want

Currently in drizzle, if you want to insert or update an array, there is a typing issue like this:

DatabaseErrorException: ERROR: column "images" is of type text[] but expression is of type text; Hint: You will need to rewrite or cast the expression.

The idea is that I should be able to insert/update an array in drizzle-orm aws-data-api.

For example:

const newListings = []
const newListing = {
  images: [...Array(8)].map(() => faker.image.url()),
  ...others
};
newListings.push(newListing)
await db.insert(listings).values(newListings)

should work when we're using aws-data-api. but it throws the error above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants