Describe the bug
Local data api is always using transactions and you cannot run queries which you need to run without transactions.
At least this is a big issue with PostgreSQL.
To Reproduce
Steps to reproduce the behavior:
import boto3
client = boto3.client('rds-data', endpoint_url='http://127.0.0.1:8080', aws_access_key_id='aaa', aws_secret_access_key='bbb')
client.execute_statement(resourceArn='arn:aws:rds:us-east-1:123456789012:cluster:dummy', secretArn='arn:aws:secretsmanager:us-east-1:123456789012:secret:dummy', sql="CREATE type some_t as enum ('A','B');", database='db')
{'ResponseMetadata': {'HTTPStatusCode': 200, 'HTTPHeaders': {'content-length': '49', 'content-type': '*/*; charset=UTF-8'}, 'RetryAttempts': 0}, 'generatedFields': [], 'numberOfRecordsUpdated': 0}
client.execute_statement(resourceArn='arn:aws:rds:us-east-1:123456789012:cluster:dummy', secretArn='arn:aws:secretsmanager:us-east-1:123456789012:secret:dummy', sql="ALTER TYPE some_t ADD VALUE IF NOT EXISTS 'NEW_VALUE'", database='db')
Traceback (most recent call last):
raise error_class(parsed_response, operation_name)
botocore.errorfactory.BadRequestException: An error occurred (BadRequestException) when calling the ExecuteStatement operation: Database error code: 0. Message: ERROR: ALTER TYPE ... ADD cannot run inside a transaction block
Expected behavior
Query will be run without problems.
Additional context
PostgreSQL v10, similar that is available in Aurora Serverless v1.
There should be option to disable always using transactions with /Execute.
Or it should even be the default as that's how the AWS data api works!
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