Skip to content

Commit 27d2721

Browse files
committed
Fix for AWS RDS Data Api RQBv2
1 parent 58f3999 commit 27d2721

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drizzle-orm/src/aws-data-api/pg/session.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class AwsDataApiPreparedQuery<
6565
resourceArn: options.resourceArn,
6666
database: options.database,
6767
transactionId,
68-
includeResultMetadata: !fields && !customResultMapper,
68+
includeResultMetadata: isRqbV2Query || (!fields && !customResultMapper),
6969
});
7070
}
7171

@@ -113,7 +113,7 @@ export class AwsDataApiPreparedQuery<
113113
const { columnMetadata, rows } = result;
114114
if (!columnMetadata) {
115115
return (customResultMapper as (rows: Record<string, unknown>[]) => T['execute'])(
116-
rows as any as Record<string, unknown>[],
116+
rows as [],
117117
);
118118
}
119119
const mappedRows = rows.map((sourceRow) => {
@@ -135,8 +135,6 @@ export class AwsDataApiPreparedQuery<
135135
return row;
136136
});
137137

138-
Object.assign(result, { rows: mappedRows });
139-
140138
return (customResultMapper as (rows: Record<string, unknown>[]) => T['execute'])(
141139
mappedRows,
142140
);

0 commit comments

Comments
 (0)