Aws Rds with drizzle

My Schema on Aws Rds is not updating , once i update my schema and generate the schema , i am not getting any errors but still the migrations seems to fail , when i try to insert into that table BadRequestException: ERROR: relation "fuc" does not exist Position: 13; SQLState: 42P01 I get this
17 Replies
Mohammed Anas
Mohammed AnasOP17mo ago
Only the first migration seems to work on AWS RDS Postgres , further changes are not recorded
fustilio.
fustilio.17mo ago
I'm facing a similar issue, using an older version of drizzle-kit seems to work previous versions (working) "drizzle-orm": "^0.23.13", "drizzle-kit": "^0.17.6", newest versions(not working) "drizzle-orm": "^0.28.2", "drizzle-kit": "^0.19.12",
fustilio.
fustilio.17mo ago
https://github.com/drizzle-team/drizzle-orm/pull/1071 This pull request seems to fix this issue.
GitHub
[AWS] fix: raw sql query not being mapped properly on RDS (#578) by...
This PR fixes the issue for raw sql queries via the aws-data-api client to not be properly mapped to the correct column names. (#578) Test cases have been added, but the typing is still a bit off. ...
Boian Ivanov
Boian Ivanov17mo ago
@fustilio. unfortunately my PR fixes the mapping for raw sql queries. It basically guaranties your return types to be as per the select and not as the aws-sdk would return them
fustilio.
fustilio.17mo ago
I found that this fixes the problem with peforming migrations using RDS. It's because of the operations performed on the "drizzle"."__drizzle_migrations" table when migrating
Boian Ivanov
Boian Ivanov17mo ago
Well that's great I suppose, but I cannot get anyone else to review it so we can move it forward 😢
Andrii Sherman
Andrii Sherman17mo ago
I'll get to it soon!
beneidel
beneidel17mo ago
just for ref I reported a duplicate of this here https://discord.com/channels/1043890932593987624/1142503448160501901/1142503448160501901 I monkeypatched this in my local env touching a line of code (shared how in the linked github issue), very nasty but happy to share if that helps troubleshooting ps: I see from the above that you’re way ahead ❤️
quitelistener
quitelistener17mo ago
is there any example of using RDS with drizzle ?
Luxaritas
Luxaritas17mo ago
FYI, you should be able to use a regular MySQL/Postgres connector if that’s viable for your setup (I use mysql2 with a non-aurora RDS instance, though I’m not using drizzle-kit currently)
Boian Ivanov
Boian Ivanov17mo ago
The issue is if you need to use Aurora Serverless on RDS, then the only option is via the data-api client and via drizzle it has its limitations
Cayter
Cayter17mo ago
U can spin up a fargate instance that's connected to Ur VPC to run the migrate command before deploying your app https://docs.aws.amazon.com/cli/latest/reference/ecs/run-task.html This is assuming that your app runs in container though and yes we are using aws RDS postgres serverless v2
Boian Ivanov
Boian Ivanov17mo ago
Assuming you're not on v1 due to the need for the data-api
Cayter
Cayter17mo ago
Data API has a lot of rough edges with most of the open source projects, I would avoid that if you need to deliver things fast
Boian Ivanov
Boian Ivanov17mo ago
Tell that to my manager 🤣
beneidel
beneidel16mo ago
fixed on last version, thank you!!
beneidel
beneidel16mo ago
(it unearthed a little bug with AWS RDS data api and deserializing array values, that I sent a little PR for https://github.com/drizzle-team/drizzle-orm/pull/1200 )
GitHub
[Pg] aws data api additional array values by benjamine · Pull Reque...
extending support from just string[] to all type of arrays, including array of arrays. using AWS RDS data api before this with a query that returns rows with for example an array of long, results i...
Want results from more Discord servers?
Add your server