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 Anas14mo ago
Only the first migration seems to work on AWS RDS Postgres , further changes are not recorded
fustilio.
fustilio.13mo 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.13mo 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 Ivanov13mo 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.13mo 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 Ivanov13mo 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 Sherman13mo ago
I'll get to it soon!
beneidel
beneidel13mo 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
quitelistener13mo ago
is there any example of using RDS with drizzle ?
Luxaritas
Luxaritas13mo 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 Ivanov13mo 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
Cayter13mo 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 Ivanov13mo ago
Assuming you're not on v1 due to the need for the data-api
Cayter
Cayter13mo 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 Ivanov13mo ago
Tell that to my manager 🤣
Want results from more Discord servers?
Add your server