Describe the bug
Using local-data-api 0.6.7 with PostgreSQL I get an error when trying to pass an array as parameters in AWS.RDSDataService function executeStatement using JavaScript.
Postgres supposts Arrays as data type and RDSDataService does as well. But using arrays with local-data-api seems to not be supported as I get the following error in the docker logs:
2021-04-08 11:59:22.921 [eventLoopGroupProxy-4-2] ERROR Application - Unhandled: POST - /Execute kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 1146: Encountered an unknown key 'arrayValue'
To Reproduce
Steps to reproduce the behavior:
col
of type TEXT[]
CREATE TABLE test ( col TEXT[] )
const AWS = require('aws-sdk');
const client = new AWS.RDSDataService({
region: 'us-east-1',
endpoint: 'http://127.0.0.1:8080',
});
(async function() {
try {
await client.executeStatement({
resourceArn: 'arn:aws:rds:us-east-1:123456789012:cluster:dummy',
secretArn: 'arn:aws:secretsmanager:us-east-1:123456789012:secret:dummy',
database: 'test',
sql: 'INSERT INTO test (col) VALUES (:data)',
parameters: [{
name: 'data',
value: {
arrayValue: {
stringValues: ['a', 'b']
},
},
}]
}).promise();
}
catch (e) {
console.log(e);
}
})();
Expected behavior
a new entry in table test
is created with the array ['a', 'b']
as value for column col
.
Additional context
AWS documentation: https://docs.aws.amazon.com/rdsdataservice/latest/APIReference/API_ExecuteStatement.html
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too