RDSDataService ************** Client ====== class RDSDataService.Client A low-level client representing AWS RDS DataService Amazon RDS provides an HTTP endpoint to run SQL statements on an Amazon Aurora DB cluster. To run these statements, you use the RDS Data API (Data API). Data API is available with the following types of Aurora databases: * Aurora PostgreSQL - Serverless v2, provisioned, and Serverless v1 * Aurora MySQL - Serverless v2, provisioned, and Serverless v1 For more information about the Data API, see Using RDS Data API in the *Amazon Aurora User Guide*. import boto3 client = boto3.client('rds-data') These are the available methods: * batch_execute_statement * begin_transaction * can_paginate * close * commit_transaction * execute_sql * execute_statement * get_paginator * get_waiter * rollback_transaction RDSDataService / Client / commit_transaction commit_transaction ****************** RDSDataService.Client.commit_transaction(**kwargs) Ends a SQL transaction started with the "BeginTransaction" operation and commits the changes. See also: AWS API Documentation **Request Syntax** response = client.commit_transaction( resourceArn='string', secretArn='string', transactionId='string' ) Parameters: * **resourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster. * **secretArn** (*string*) -- **[REQUIRED]** The name or ARN of the secret that enables access to the DB cluster. * **transactionId** (*string*) -- **[REQUIRED]** The identifier of the transaction to end and commit. Return type: dict Returns: **Response Syntax** { 'transactionStatus': 'string' } **Response Structure** * *(dict) --* The response elements represent the output of a commit transaction request. * **transactionStatus** *(string) --* The status of the commit operation. **Exceptions** * "RDSDataService.Client.exceptions.SecretsErrorException" * "RDSDataService.Client.exceptions.HttpEndpointNotEnabledExceptio n" * "RDSDataService.Client.exceptions.DatabaseErrorException" * "RDSDataService.Client.exceptions.DatabaseUnavailableException" * "RDSDataService.Client.exceptions.TransactionNotFoundException" * "RDSDataService.Client.exceptions.InvalidSecretException" * "RDSDataService.Client.exceptions.InvalidResourceStateException" * "RDSDataService.Client.exceptions.ServiceUnavailableError" * "RDSDataService.Client.exceptions.ForbiddenException" * "RDSDataService.Client.exceptions.DatabaseNotFoundException" * "RDSDataService.Client.exceptions.AccessDeniedException" * "RDSDataService.Client.exceptions.BadRequestException" * "RDSDataService.Client.exceptions.StatementTimeoutException" * "RDSDataService.Client.exceptions.InternalServerErrorException" * "RDSDataService.Client.exceptions.NotFoundException" RDSDataService / Client / get_paginator get_paginator ************* RDSDataService.Client.get_paginator(operation_name) Create a paginator for an operation. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Raises: **OperationNotPageableError** -- Raised if the operation is not pageable. You can use the "client.can_paginate" method to check if an operation is pageable. Return type: "botocore.paginate.Paginator" Returns: A paginator object. RDSDataService / Client / can_paginate can_paginate ************ RDSDataService.Client.can_paginate(operation_name) Check if an operation can be paginated. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Returns: "True" if the operation can be paginated, "False" otherwise. RDSDataService / Client / begin_transaction begin_transaction ***************** RDSDataService.Client.begin_transaction(**kwargs) Starts a SQL transaction. Note: A transaction can run for a maximum of 24 hours. A transaction is terminated and rolled back automatically after 24 hours.A transaction times out if no calls use its transaction ID in three minutes. If a transaction times out before it's committed, it's rolled back automatically.For Aurora MySQL, DDL statements inside a transaction cause an implicit commit. We recommend that you run each MySQL DDL statement in a separate "ExecuteStatement" call with "continueAfterTimeout" enabled. See also: AWS API Documentation **Request Syntax** response = client.begin_transaction( resourceArn='string', secretArn='string', database='string', schema='string' ) Parameters: * **resourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster. * **secretArn** (*string*) -- **[REQUIRED]** The name or ARN of the secret that enables access to the DB cluster. * **database** (*string*) -- The name of the database. * **schema** (*string*) -- The name of the database schema. Return type: dict Returns: **Response Syntax** { 'transactionId': 'string' } **Response Structure** * *(dict) --* The response elements represent the output of a request to start a SQL transaction. * **transactionId** *(string) --* The transaction ID of the transaction started by the call. **Exceptions** * "RDSDataService.Client.exceptions.SecretsErrorException" * "RDSDataService.Client.exceptions.HttpEndpointNotEnabledExceptio n" * "RDSDataService.Client.exceptions.DatabaseErrorException" * "RDSDataService.Client.exceptions.DatabaseResumingException" * "RDSDataService.Client.exceptions.DatabaseUnavailableException" * "RDSDataService.Client.exceptions.TransactionNotFoundException" * "RDSDataService.Client.exceptions.InvalidSecretException" * "RDSDataService.Client.exceptions.InvalidResourceStateException" * "RDSDataService.Client.exceptions.ServiceUnavailableError" * "RDSDataService.Client.exceptions.ForbiddenException" * "RDSDataService.Client.exceptions.DatabaseNotFoundException" * "RDSDataService.Client.exceptions.AccessDeniedException" * "RDSDataService.Client.exceptions.BadRequestException" * "RDSDataService.Client.exceptions.StatementTimeoutException" * "RDSDataService.Client.exceptions.InternalServerErrorException" RDSDataService / Client / batch_execute_statement batch_execute_statement *********************** RDSDataService.Client.batch_execute_statement(**kwargs) Runs a batch SQL statement over an array of data. You can run bulk update and insert operations for multiple records using a DML statement with different parameter sets. Bulk operations can provide a significant performance improvement over individual insert and update operations. Note: If a call isn't part of a transaction because it doesn't include the "transactionID" parameter, changes that result from the call are committed automatically.There isn't a fixed upper limit on the number of parameter sets. However, the maximum size of the HTTP request submitted through the Data API is 4 MiB. If the request exceeds this limit, the Data API returns an error and doesn't process the request. This 4-MiB limit includes the size of the HTTP headers and the JSON notation in the request. Thus, the number of parameter sets that you can include depends on a combination of factors, such as the size of the SQL statement and the size of each parameter set.The response size limit is 1 MiB. If the call returns more than 1 MiB of response data, the call is terminated. See also: AWS API Documentation **Request Syntax** response = client.batch_execute_statement( resourceArn='string', secretArn='string', sql='string', database='string', schema='string', parameterSets=[ [ { 'name': 'string', 'value': { 'isNull': True|False, 'booleanValue': True|False, 'longValue': 123, 'doubleValue': 123.0, 'stringValue': 'string', 'blobValue': b'bytes', 'arrayValue': { 'booleanValues': [ True|False, ], 'longValues': [ 123, ], 'doubleValues': [ 123.0, ], 'stringValues': [ 'string', ], 'arrayValues': [ {'... recursive ...'}, ] } }, 'typeHint': 'JSON'|'UUID'|'TIMESTAMP'|'DATE'|'TIME'|'DECIMAL' }, ], ], transactionId='string' ) Parameters: * **resourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster. * **secretArn** (*string*) -- **[REQUIRED]** The ARN of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret. For information about creating the secret, see Create a database secret. * **sql** (*string*) -- **[REQUIRED]** The SQL statement to run. Don't include a semicolon (;) at the end of the SQL statement. * **database** (*string*) -- The name of the database. * **schema** (*string*) -- The name of the database schema. Note: Currently, the "schema" parameter isn't supported. * **parameterSets** (*list*) -- The parameter set for the batch operation. The SQL statement is executed as many times as the number of parameter sets provided. To execute a SQL statement with no parameters, use one of the following options: * Specify one or more empty parameter sets. * Use the "ExecuteStatement" operation instead of the "BatchExecuteStatement" operation. Note: Array parameters are not supported. * *(list) --* * *(dict) --* A parameter used in a SQL statement. * **name** *(string) --* The name of the parameter. * **value** *(dict) --* The value of the parameter. Note: This is a Tagged Union structure. Only one of the following top level keys can be set: "isNull", "booleanValue", "longValue", "doubleValue", "stringValue", "blobValue", "arrayValue". * **isNull** *(boolean) --* A NULL value. * **booleanValue** *(boolean) --* A value of Boolean data type. * **longValue** *(integer) --* A value of long data type. * **doubleValue** *(float) --* A value of double data type. * **stringValue** *(string) --* A value of string data type. * **blobValue** *(bytes) --* A value of BLOB data type. * **arrayValue** *(dict) --* An array of values. Note: This is a Tagged Union structure. Only one of the following top level keys can be set: "booleanValues", "longValues", "doubleValues", "stringValues", "arrayValues". * **booleanValues** *(list) --* An array of Boolean values. * *(boolean) --* * **longValues** *(list) --* An array of integers. * *(integer) --* * **doubleValues** *(list) --* An array of floating-point numbers. * *(float) --* * **stringValues** *(list) --* An array of strings. * *(string) --* * **arrayValues** *(list) --* An array of arrays. * *(dict) --* Contains an array. Note: This is a Tagged Union structure. Only one of the following top level keys can be set: "booleanValues", "longValues", "doubleValues", "stringValues", "arrayValues". * **typeHint** *(string) --* A hint that specifies the correct object type for data type mapping. Possible values are as follows: * "DATE" - The corresponding "String" parameter value is sent as an object of "DATE" type to the database. The accepted format is "YYYY-MM-DD". * "DECIMAL" - The corresponding "String" parameter value is sent as an object of "DECIMAL" type to the database. * "JSON" - The corresponding "String" parameter value is sent as an object of "JSON" type to the database. * "TIME" - The corresponding "String" parameter value is sent as an object of "TIME" type to the database. The accepted format is "HH:MM:SS[.FFF]". * "TIMESTAMP" - The corresponding "String" parameter value is sent as an object of "TIMESTAMP" type to the database. The accepted format is "YYYY-MM-DD HH:MM:SS[.FFF]". * "UUID" - The corresponding "String" parameter value is sent as an object of "UUID" type to the database. * **transactionId** (*string*) -- The identifier of a transaction that was started by using the "BeginTransaction" operation. Specify the transaction ID of the transaction that you want to include the SQL statement in. If the SQL statement is not part of a transaction, don't set this parameter. Return type: dict Returns: **Response Syntax** { 'updateResults': [ { 'generatedFields': [ { 'isNull': True|False, 'booleanValue': True|False, 'longValue': 123, 'doubleValue': 123.0, 'stringValue': 'string', 'blobValue': b'bytes', 'arrayValue': { 'booleanValues': [ True|False, ], 'longValues': [ 123, ], 'doubleValues': [ 123.0, ], 'stringValues': [ 'string', ], 'arrayValues': [ {'... recursive ...'}, ] } }, ] }, ] } **Response Structure** * *(dict) --* The response elements represent the output of a SQL statement over an array of data. * **updateResults** *(list) --* The execution results of each batch entry. * *(dict) --* The response elements represent the results of an update. * **generatedFields** *(list) --* Values for fields generated during the request. * *(dict) --* Contains a value. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "isNull", "booleanValue", "longValue", "doubleValue", "stringValue", "blobValue", "arrayValue". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **isNull** *(boolean) --* A NULL value. * **booleanValue** *(boolean) --* A value of Boolean data type. * **longValue** *(integer) --* A value of long data type. * **doubleValue** *(float) --* A value of double data type. * **stringValue** *(string) --* A value of string data type. * **blobValue** *(bytes) --* A value of BLOB data type. * **arrayValue** *(dict) --* An array of values. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "booleanValues", "longValues", "doubleValues", "stringValues", "arrayValues". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **booleanValues** *(list) --* An array of Boolean values. * *(boolean) --* * **longValues** *(list) --* An array of integers. * *(integer) --* * **doubleValues** *(list) --* An array of floating-point numbers. * *(float) --* * **stringValues** *(list) --* An array of strings. * *(string) --* * **arrayValues** *(list) --* An array of arrays. * *(dict) --* Contains an array. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "booleanValues", "longValues", "doubleValues", "stringValues", "arrayValues". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} **Exceptions** * "RDSDataService.Client.exceptions.SecretsErrorException" * "RDSDataService.Client.exceptions.HttpEndpointNotEnabledExceptio n" * "RDSDataService.Client.exceptions.DatabaseErrorException" * "RDSDataService.Client.exceptions.DatabaseResumingException" * "RDSDataService.Client.exceptions.DatabaseUnavailableException" * "RDSDataService.Client.exceptions.TransactionNotFoundException" * "RDSDataService.Client.exceptions.InvalidSecretException" * "RDSDataService.Client.exceptions.InvalidResourceStateException" * "RDSDataService.Client.exceptions.ServiceUnavailableError" * "RDSDataService.Client.exceptions.ForbiddenException" * "RDSDataService.Client.exceptions.DatabaseNotFoundException" * "RDSDataService.Client.exceptions.AccessDeniedException" * "RDSDataService.Client.exceptions.BadRequestException" * "RDSDataService.Client.exceptions.StatementTimeoutException" * "RDSDataService.Client.exceptions.InternalServerErrorException" RDSDataService / Client / rollback_transaction rollback_transaction ******************** RDSDataService.Client.rollback_transaction(**kwargs) Performs a rollback of a transaction. Rolling back a transaction cancels its changes. See also: AWS API Documentation **Request Syntax** response = client.rollback_transaction( resourceArn='string', secretArn='string', transactionId='string' ) Parameters: * **resourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster. * **secretArn** (*string*) -- **[REQUIRED]** The name or ARN of the secret that enables access to the DB cluster. * **transactionId** (*string*) -- **[REQUIRED]** The identifier of the transaction to roll back. Return type: dict Returns: **Response Syntax** { 'transactionStatus': 'string' } **Response Structure** * *(dict) --* The response elements represent the output of a request to perform a rollback of a transaction. * **transactionStatus** *(string) --* The status of the rollback operation. **Exceptions** * "RDSDataService.Client.exceptions.SecretsErrorException" * "RDSDataService.Client.exceptions.HttpEndpointNotEnabledExceptio n" * "RDSDataService.Client.exceptions.DatabaseErrorException" * "RDSDataService.Client.exceptions.DatabaseUnavailableException" * "RDSDataService.Client.exceptions.TransactionNotFoundException" * "RDSDataService.Client.exceptions.InvalidSecretException" * "RDSDataService.Client.exceptions.InvalidResourceStateException" * "RDSDataService.Client.exceptions.ServiceUnavailableError" * "RDSDataService.Client.exceptions.ForbiddenException" * "RDSDataService.Client.exceptions.DatabaseNotFoundException" * "RDSDataService.Client.exceptions.AccessDeniedException" * "RDSDataService.Client.exceptions.BadRequestException" * "RDSDataService.Client.exceptions.StatementTimeoutException" * "RDSDataService.Client.exceptions.InternalServerErrorException" * "RDSDataService.Client.exceptions.NotFoundException" RDSDataService / Client / get_waiter get_waiter ********** RDSDataService.Client.get_waiter(waiter_name) Returns an object that can wait for some condition. Parameters: **waiter_name** (*str*) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters. Returns: The specified waiter object. Return type: "botocore.waiter.Waiter" RDSDataService / Client / execute_statement execute_statement ***************** RDSDataService.Client.execute_statement(**kwargs) Runs a SQL statement against a database. Note: If a call isn't part of a transaction because it doesn't include the "transactionID" parameter, changes that result from the call are committed automatically.If the binary response data from the database is more than 1 MB, the call is terminated. See also: AWS API Documentation **Request Syntax** response = client.execute_statement( resourceArn='string', secretArn='string', sql='string', database='string', schema='string', parameters=[ { 'name': 'string', 'value': { 'isNull': True|False, 'booleanValue': True|False, 'longValue': 123, 'doubleValue': 123.0, 'stringValue': 'string', 'blobValue': b'bytes', 'arrayValue': { 'booleanValues': [ True|False, ], 'longValues': [ 123, ], 'doubleValues': [ 123.0, ], 'stringValues': [ 'string', ], 'arrayValues': [ {'... recursive ...'}, ] } }, 'typeHint': 'JSON'|'UUID'|'TIMESTAMP'|'DATE'|'TIME'|'DECIMAL' }, ], transactionId='string', includeResultMetadata=True|False, continueAfterTimeout=True|False, resultSetOptions={ 'decimalReturnType': 'STRING'|'DOUBLE_OR_LONG', 'longReturnType': 'STRING'|'LONG' }, formatRecordsAs='NONE'|'JSON' ) Parameters: * **resourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster. * **secretArn** (*string*) -- **[REQUIRED]** The ARN of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret. For information about creating the secret, see Create a database secret. * **sql** (*string*) -- **[REQUIRED]** The SQL statement to run. * **database** (*string*) -- The name of the database. * **schema** (*string*) -- The name of the database schema. Note: Currently, the "schema" parameter isn't supported. * **parameters** (*list*) -- The parameters for the SQL statement. Note: Array parameters are not supported. * *(dict) --* A parameter used in a SQL statement. * **name** *(string) --* The name of the parameter. * **value** *(dict) --* The value of the parameter. Note: This is a Tagged Union structure. Only one of the following top level keys can be set: "isNull", "booleanValue", "longValue", "doubleValue", "stringValue", "blobValue", "arrayValue". * **isNull** *(boolean) --* A NULL value. * **booleanValue** *(boolean) --* A value of Boolean data type. * **longValue** *(integer) --* A value of long data type. * **doubleValue** *(float) --* A value of double data type. * **stringValue** *(string) --* A value of string data type. * **blobValue** *(bytes) --* A value of BLOB data type. * **arrayValue** *(dict) --* An array of values. Note: This is a Tagged Union structure. Only one of the following top level keys can be set: "booleanValues", "longValues", "doubleValues", "stringValues", "arrayValues". * **booleanValues** *(list) --* An array of Boolean values. * *(boolean) --* * **longValues** *(list) --* An array of integers. * *(integer) --* * **doubleValues** *(list) --* An array of floating-point numbers. * *(float) --* * **stringValues** *(list) --* An array of strings. * *(string) --* * **arrayValues** *(list) --* An array of arrays. * *(dict) --* Contains an array. Note: This is a Tagged Union structure. Only one of the following top level keys can be set: "booleanValues", "longValues", "doubleValues", "stringValues", "arrayValues". * **typeHint** *(string) --* A hint that specifies the correct object type for data type mapping. Possible values are as follows: * "DATE" - The corresponding "String" parameter value is sent as an object of "DATE" type to the database. The accepted format is "YYYY-MM-DD". * "DECIMAL" - The corresponding "String" parameter value is sent as an object of "DECIMAL" type to the database. * "JSON" - The corresponding "String" parameter value is sent as an object of "JSON" type to the database. * "TIME" - The corresponding "String" parameter value is sent as an object of "TIME" type to the database. The accepted format is "HH:MM:SS[.FFF]". * "TIMESTAMP" - The corresponding "String" parameter value is sent as an object of "TIMESTAMP" type to the database. The accepted format is "YYYY-MM-DD HH:MM:SS[.FFF]". * "UUID" - The corresponding "String" parameter value is sent as an object of "UUID" type to the database. * **transactionId** (*string*) -- The identifier of a transaction that was started by using the "BeginTransaction" operation. Specify the transaction ID of the transaction that you want to include the SQL statement in. If the SQL statement is not part of a transaction, don't set this parameter. * **includeResultMetadata** (*boolean*) -- A value that indicates whether to include metadata in the results. * **continueAfterTimeout** (*boolean*) -- A value that indicates whether to continue running the statement after the call times out. By default, the statement stops running when the call times out. Note: For DDL statements, we recommend continuing to run the statement after the call times out. When a DDL statement terminates before it is finished running, it can result in errors and possibly corrupted data structures. * **resultSetOptions** (*dict*) -- Options that control how the result set is returned. * **decimalReturnType** *(string) --* A value that indicates how a field of "DECIMAL" type is represented in the response. The value of "STRING", the default, specifies that it is converted to a String value. The value of "DOUBLE_OR_LONG" specifies that it is converted to a Long value if its scale is 0, or to a Double value otherwise. Note: Conversion to Double or Long can result in roundoff errors due to precision loss. We recommend converting to String, especially when working with currency values. * **longReturnType** *(string) --* A value that indicates how a field of "LONG" type is represented. Allowed values are "LONG" and "STRING". The default is "LONG". Specify "STRING" if the length or precision of numeric values might cause truncation or rounding errors. * **formatRecordsAs** (*string*) -- A value that indicates whether to format the result set as a single JSON string. This parameter only applies to "SELECT" statements and is ignored for other types of statements. Allowed values are "NONE" and "JSON". The default value is "NONE". The result is returned in the "formattedRecords" field. For usage information about the JSON format for result sets, see Using the Data API in the *Amazon Aurora User Guide*. Return type: dict Returns: **Response Syntax** { 'records': [ [ { 'isNull': True|False, 'booleanValue': True|False, 'longValue': 123, 'doubleValue': 123.0, 'stringValue': 'string', 'blobValue': b'bytes', 'arrayValue': { 'booleanValues': [ True|False, ], 'longValues': [ 123, ], 'doubleValues': [ 123.0, ], 'stringValues': [ 'string', ], 'arrayValues': [ {'... recursive ...'}, ] } }, ], ], 'columnMetadata': [ { 'name': 'string', 'type': 123, 'typeName': 'string', 'label': 'string', 'schemaName': 'string', 'tableName': 'string', 'isAutoIncrement': True|False, 'isSigned': True|False, 'isCurrency': True|False, 'isCaseSensitive': True|False, 'nullable': 123, 'precision': 123, 'scale': 123, 'arrayBaseColumnType': 123 }, ], 'numberOfRecordsUpdated': 123, 'generatedFields': [ { 'isNull': True|False, 'booleanValue': True|False, 'longValue': 123, 'doubleValue': 123.0, 'stringValue': 'string', 'blobValue': b'bytes', 'arrayValue': { 'booleanValues': [ True|False, ], 'longValues': [ 123, ], 'doubleValues': [ 123.0, ], 'stringValues': [ 'string', ], 'arrayValues': [ {'... recursive ...'}, ] } }, ], 'formattedRecords': 'string' } **Response Structure** * *(dict) --* The response elements represent the output of a request to run a SQL statement against a database. * **records** *(list) --* The records returned by the SQL statement. This field is blank if the "formatRecordsAs" parameter is set to "JSON". * *(list) --* * *(dict) --* Contains a value. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "isNull", "booleanValue", "longValue", "doubleValue", "stringValue", "blobValue", "arrayValue". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **isNull** *(boolean) --* A NULL value. * **booleanValue** *(boolean) --* A value of Boolean data type. * **longValue** *(integer) --* A value of long data type. * **doubleValue** *(float) --* A value of double data type. * **stringValue** *(string) --* A value of string data type. * **blobValue** *(bytes) --* A value of BLOB data type. * **arrayValue** *(dict) --* An array of values. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "booleanValues", "longValues", "doubleValues", "stringValues", "arrayValues". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **booleanValues** *(list) --* An array of Boolean values. * *(boolean) --* * **longValues** *(list) --* An array of integers. * *(integer) --* * **doubleValues** *(list) --* An array of floating-point numbers. * *(float) --* * **stringValues** *(list) --* An array of strings. * *(string) --* * **arrayValues** *(list) --* An array of arrays. * *(dict) --* Contains an array. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "booleanValues", "longValues", "doubleValues", "stringValues", "arrayValues". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **columnMetadata** *(list) --* Metadata for the columns included in the results. This field is blank if the "formatRecordsAs" parameter is set to "JSON". * *(dict) --* Contains the metadata for a column. * **name** *(string) --* The name of the column. * **type** *(integer) --* The type of the column. * **typeName** *(string) --* The database-specific data type of the column. * **label** *(string) --* The label for the column. * **schemaName** *(string) --* The name of the schema that owns the table that includes the column. * **tableName** *(string) --* The name of the table that includes the column. * **isAutoIncrement** *(boolean) --* A value that indicates whether the column increments automatically. * **isSigned** *(boolean) --* A value that indicates whether an integer column is signed. * **isCurrency** *(boolean) --* A value that indicates whether the column contains currency values. * **isCaseSensitive** *(boolean) --* A value that indicates whether the column is case- sensitive. * **nullable** *(integer) --* A value that indicates whether the column is nullable. * **precision** *(integer) --* The precision value of a decimal number column. * **scale** *(integer) --* The scale value of a decimal number column. * **arrayBaseColumnType** *(integer) --* The type of the column. * **numberOfRecordsUpdated** *(integer) --* The number of records updated by the request. * **generatedFields** *(list) --* Values for fields generated during a DML request. Note: The "generatedFields" data isn't supported by Aurora PostgreSQL. To get the values of generated fields, use the "RETURNING" clause. For more information, see Returning Data From Modified Rows in the PostgreSQL documentation. * *(dict) --* Contains a value. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "isNull", "booleanValue", "longValue", "doubleValue", "stringValue", "blobValue", "arrayValue". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **isNull** *(boolean) --* A NULL value. * **booleanValue** *(boolean) --* A value of Boolean data type. * **longValue** *(integer) --* A value of long data type. * **doubleValue** *(float) --* A value of double data type. * **stringValue** *(string) --* A value of string data type. * **blobValue** *(bytes) --* A value of BLOB data type. * **arrayValue** *(dict) --* An array of values. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "booleanValues", "longValues", "doubleValues", "stringValues", "arrayValues". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **booleanValues** *(list) --* An array of Boolean values. * *(boolean) --* * **longValues** *(list) --* An array of integers. * *(integer) --* * **doubleValues** *(list) --* An array of floating-point numbers. * *(float) --* * **stringValues** *(list) --* An array of strings. * *(string) --* * **arrayValues** *(list) --* An array of arrays. * *(dict) --* Contains an array. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "booleanValues", "longValues", "doubleValues", "stringValues", "arrayValues". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **formattedRecords** *(string) --* A string value that represents the result set of a "SELECT" statement in JSON format. This value is only present when the "formatRecordsAs" parameter is set to "JSON". The size limit for this field is currently 10 MB. If the JSON-formatted string representing the result set requires more than 10 MB, the call returns an error. **Exceptions** * "RDSDataService.Client.exceptions.SecretsErrorException" * "RDSDataService.Client.exceptions.HttpEndpointNotEnabledExceptio n" * "RDSDataService.Client.exceptions.DatabaseErrorException" * "RDSDataService.Client.exceptions.DatabaseResumingException" * "RDSDataService.Client.exceptions.DatabaseUnavailableException" * "RDSDataService.Client.exceptions.TransactionNotFoundException" * "RDSDataService.Client.exceptions.InvalidSecretException" * "RDSDataService.Client.exceptions.InvalidResourceStateException" * "RDSDataService.Client.exceptions.ServiceUnavailableError" * "RDSDataService.Client.exceptions.ForbiddenException" * "RDSDataService.Client.exceptions.DatabaseNotFoundException" * "RDSDataService.Client.exceptions.AccessDeniedException" * "RDSDataService.Client.exceptions.BadRequestException" * "RDSDataService.Client.exceptions.StatementTimeoutException" * "RDSDataService.Client.exceptions.InternalServerErrorException" * "RDSDataService.Client.exceptions.UnsupportedResultException" RDSDataService / Client / execute_sql execute_sql *********** RDSDataService.Client.execute_sql(**kwargs) Runs one or more SQL statements. Note: This operation isn't supported for Aurora Serverless v2 and provisioned DB clusters. For Aurora Serverless v1 DB clusters, the operation is deprecated. Use the "BatchExecuteStatement" or "ExecuteStatement" operation. Danger: This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity. See also: AWS API Documentation **Request Syntax** response = client.execute_sql( dbClusterOrInstanceArn='string', awsSecretStoreArn='string', sqlStatements='string', database='string', schema='string' ) Parameters: * **dbClusterOrInstanceArn** (*string*) -- **[REQUIRED]** The ARN of the Aurora Serverless DB cluster. * **awsSecretStoreArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the secret that enables access to the DB cluster. Enter the database user name and password for the credentials in the secret. For information about creating the secret, see Create a database secret. * **sqlStatements** (*string*) -- **[REQUIRED]** One or more SQL statements to run on the DB cluster. You can separate SQL statements from each other with a semicolon (;). Any valid SQL statement is permitted, including data definition, data manipulation, and commit statements. * **database** (*string*) -- The name of the database. * **schema** (*string*) -- The name of the database schema. Return type: dict Returns: **Response Syntax** { 'sqlStatementResults': [ { 'resultFrame': { 'resultSetMetadata': { 'columnCount': 123, 'columnMetadata': [ { 'name': 'string', 'type': 123, 'typeName': 'string', 'label': 'string', 'schemaName': 'string', 'tableName': 'string', 'isAutoIncrement': True|False, 'isSigned': True|False, 'isCurrency': True|False, 'isCaseSensitive': True|False, 'nullable': 123, 'precision': 123, 'scale': 123, 'arrayBaseColumnType': 123 }, ] }, 'records': [ { 'values': [ { 'isNull': True|False, 'bitValue': True|False, 'bigIntValue': 123, 'intValue': 123, 'doubleValue': 123.0, 'realValue': ..., 'stringValue': 'string', 'blobValue': b'bytes', 'arrayValues': [ {'... recursive ...'}, ], 'structValue': { 'attributes': [ {'... recursive ...'}, ] } }, ] }, ] }, 'numberOfRecordsUpdated': 123 }, ] } **Response Structure** * *(dict) --* The response elements represent the output of a request to run one or more SQL statements. * **sqlStatementResults** *(list) --* The results of the SQL statement or statements. * *(dict) --* The result of a SQL statement. Note: This data structure is only used with the deprecated "ExecuteSql" operation. Use the "BatchExecuteStatement" or "ExecuteStatement" operation instead. * **resultFrame** *(dict) --* The result set of the SQL statement. * **resultSetMetadata** *(dict) --* The result-set metadata in the result set. * **columnCount** *(integer) --* The number of columns in the result set. * **columnMetadata** *(list) --* The metadata of the columns in the result set. * *(dict) --* Contains the metadata for a column. * **name** *(string) --* The name of the column. * **type** *(integer) --* The type of the column. * **typeName** *(string) --* The database-specific data type of the column. * **label** *(string) --* The label for the column. * **schemaName** *(string) --* The name of the schema that owns the table that includes the column. * **tableName** *(string) --* The name of the table that includes the column. * **isAutoIncrement** *(boolean) --* A value that indicates whether the column increments automatically. * **isSigned** *(boolean) --* A value that indicates whether an integer column is signed. * **isCurrency** *(boolean) --* A value that indicates whether the column contains currency values. * **isCaseSensitive** *(boolean) --* A value that indicates whether the column is case-sensitive. * **nullable** *(integer) --* A value that indicates whether the column is nullable. * **precision** *(integer) --* The precision value of a decimal number column. * **scale** *(integer) --* The scale value of a decimal number column. * **arrayBaseColumnType** *(integer) --* The type of the column. * **records** *(list) --* The records in the result set. * *(dict) --* A record returned by a call. Note: This data structure is only used with the deprecated "ExecuteSql" operation. Use the "BatchExecuteStatement" or "ExecuteStatement" operation instead. * **values** *(list) --* The values returned in the record. * *(dict) --* Contains the value of a column. Note: This data structure is only used with the deprecated "ExecuteSql" operation. Use the "BatchExecuteStatement" or "ExecuteStatement" operation instead. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "isNull", "bitValue", "bigIntValue", "intValue", "doubleValue", "realValue", "stringValue", "blobValue", "arrayValues", "structValue". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **isNull** *(boolean) --* A NULL value. * **bitValue** *(boolean) --* A value for a column of BIT data type. * **bigIntValue** *(integer) --* A value for a column of big integer data type. * **intValue** *(integer) --* A value for a column of integer data type. * **doubleValue** *(float) --* A value for a column of double data type. * **realValue** *(float) --* A value for a column of real data type. * **stringValue** *(string) --* A value for a column of string data type. * **blobValue** *(bytes) --* A value for a column of BLOB data type. * **arrayValues** *(list) --* An array of column values. * *(dict) --* Contains the value of a column. Note: This data structure is only used with the deprecated "ExecuteSql" operation. Use the "BatchExecuteStatement" or "ExecuteStatement" operation instead. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "isNull", "bitValue", "bigIntValue", "intValue", "doubleValue", "realValue", "stringValue", "blobValue", "arrayValues", "structValue". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **structValue** *(dict) --* A value for a column of STRUCT data type. * **attributes** *(list) --* The attributes returned in the record. * *(dict) --* Contains the value of a column. Note: This data structure is only used with the deprecated "ExecuteSql" operation. Use the "BatchExecuteStatement" or "ExecuteStatement" operation instead. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "isNull", "bitValue", "bigIntValue", "intValue", "doubleValue", "realValue", "stringValue", "blobValue", "arrayValues", "structValue". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **numberOfRecordsUpdated** *(integer) --* The number of records updated by a SQL statement. **Exceptions** * "RDSDataService.Client.exceptions.AccessDeniedException" * "RDSDataService.Client.exceptions.BadRequestException" * "RDSDataService.Client.exceptions.InternalServerErrorException" * "RDSDataService.Client.exceptions.ForbiddenException" * "RDSDataService.Client.exceptions.ServiceUnavailableError" RDSDataService / Client / close close ***** RDSDataService.Client.close() Closes underlying endpoint connections.