跳至內容

Aurora serverless, RDSDataService, executeStatement() API, " Unexpected key 'formatRecordsAs' found in params" error

1

Hello, I'm trying to add formatRecordsAs parameter to sqlParams for Aurora serverless RDSDataService (according to RDSDataService SDK) and getting "Unexpected key 'formatRecordsAs' found in params". Here is my code sample:

let sqlParams = {
        secretArn: storeArn.Value,
        resourceArn: dbArn.Value,
        database: dbSchema.Value,
        formatRecordsAs: 'JSON'
      };
sqlParams.sql = `select ...`;
let data = await RDS.executeStatement(sqlParams).promise();

Note that without "formatRecordsAs" parameter all works just fine. I double checked with RDSDataService SDK docs and didn't find any inconsistency in my code. What I might possibly missing here???

Thank you,

Victor.

已提問 4 年前檢視次數 497 次

1 個回答
0

Hi, if you are using a lambda function, then the sdk version in use is 2.1055 at the time of this answer (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html), and in this version 'formatRecordAs' parameter isn't supported.

As a workaround, you should create a lambda layer with a more recent sdk version (v3 is already available).

Hope this helps :)

已回答 4 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。