drizzle-team / drizzle-team/drizzle-orm
[BUG]: AWS Data API Postgres - incompatibility with latest @aws-sdk/client-rds-data (3.932.0)
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Report hasn't been filed before.
- [x] I have verified that the bug I'm about to report hasn't been filed before.
### What version of `drizzle-orm` are you using?
0.44.7
### What version of `drizzle-kit` are you using?
0.31.7
### Other packages
_No response_
### Describe the Bug
Hello Drizzle Team,
We use an AWS Data API integration for Drizzle, which has been working fine until recently. After updating
`@aws-sdk/client-rds-data` to latest version - `3.932.0` `drizzle-kit migrate` (drizzle-kit@0.31.7) script stopped working.
This is the error that gets thrown
```
Reading config file '/Users/workfolder/drizzle.config.ts'
[⣷] applying migrations...DrizzleQueryError: Failed query: CREATE SCHEMA IF NOT EXISTS "drizzle"
params:
at AwsDataApiPreparedQuery.queryWithCache (/Users/workfolder/node_modules/src/pg-core/session.ts:73:11)
at async AwsDataApiPreparedQuery.values (/Users/workfolder/node_modules/src/aws-data-api/pg/session.ts:120:18)
at async AwsDataApiPreparedQuery.execute (/Users/workfolder/node_modules/src/aws-data-api/pg/session.ts:70:18)
at async AwsPgDialect.migrate (/Users/workfolder/node_modules/src/pg-core/dialect.ts:85:3)
at async migrate (/Users/workfolder/node_modules/src/aws-data-api/pg/migrator.ts:10:2) {
query: 'CREATE SCHEMA IF NOT EXISTS "drizzle"',
params: [],
cause: Error: serializerMiddleware is not found when adding endpointV2Middleware middleware before serializerMiddleware
at /Users/workfolder/node_modules/drizzle-kit/bin.cjs:54639:21
at Array.forEach ()
at getMiddlewareList (/Users/workfolder/node_modules/drizzle-kit/bin.cjs:54632:35)
at Object.resolve (/Users/workfolder/node_modules/drizzle-kit/bin.cjs:54785:36)
at ExecuteStatementCommand.resolveMiddlewareWithContext (/Users/workfolder/node_modules/@smithy/smithy-client/dist-cjs/index.js:113:22)
at ExecuteStatementCommand.resolveMiddleware (/Users/workfolder/node_modules/@smithy/smithy-client/dist-cjs/index.js:193:29)
at _a2.send (/Users/workfolder/node_modules/drizzle-kit/bin.cjs:54888:29)
at (/Users/workfolder/node_modules/src/aws-data-api/pg/session.ts:121:29)
at AwsDataApiPreparedQuery.queryWithCache (/Users/workfolder/node_modules/src/pg-core/session.ts:71:18)
at AwsDataApiPreparedQuery.values (/Users/workfolder/node_modules/src/aws-data-api/pg/session.ts:120:29)
}
Migration attempt failed: Command failed: drizzle-kit migrate
```
After downgrading @aws-sdk/client-rds-data to `3.873.0`, it works fine again
Contributor guide
Research direction
Start by reproducing drizzle-kit migrate with @aws-sdk/client-rds-data 3.932.0 and the working 3.873.0 version. Read src/aws-data-api/pg/session.ts, src/pg-core/session.ts, and the middleware stack in the reported drizzle-kit path to compare the dependency behavior. Done means migrations work with the latest SDK and the regression is covered by an available test or reproducible verification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, postgresql, typescript
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100