import { Command as $Command } from "@smithy/core/client"; import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import type { ExecuteStatementRequest, ExecuteStatementResponse } from "../models/models_0"; import type { RDSDataClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RDSDataClient"; /** * @public */ export type { __MetadataBearer }; export { $Command }; /** * @public * * The input for {@link ExecuteStatementCommand}. */ export interface ExecuteStatementCommandInput extends ExecuteStatementRequest { } /** * @public * * The output of {@link ExecuteStatementCommand}. */ export interface ExecuteStatementCommandOutput extends ExecuteStatementResponse, __MetadataBearer { } declare const ExecuteStatementCommand_base: { new (input: ExecuteStatementCommandInput): import("@smithy/core/client").CommandImpl; new (input: ExecuteStatementCommandInput): import("@smithy/core/client").CommandImpl; getEndpointParameterInstructions(): { [x: string]: unknown; }; }; /** *

Runs a SQL statement against a database.

* *

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.

*
* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { RDSDataClient, ExecuteStatementCommand } from "@aws-sdk/client-rds-data"; // ES Modules import * // const { RDSDataClient, ExecuteStatementCommand } = require("@aws-sdk/client-rds-data"); // CommonJS import * // import type { RDSDataClientConfig } from "@aws-sdk/client-rds-data"; * const config = {}; // type is RDSDataClientConfig * const client = new RDSDataClient(config); * const input = { // ExecuteStatementRequest * resourceArn: "STRING_VALUE", // required * secretArn: "STRING_VALUE", // required * sql: "STRING_VALUE", // required * database: "STRING_VALUE", * schema: "STRING_VALUE", * parameters: [ // SqlParametersList * { // SqlParameter * name: "STRING_VALUE", * value: { // Field Union: only one key present * isNull: true || false, * booleanValue: true || false, * longValue: Number("long"), * doubleValue: Number("double"), * stringValue: "STRING_VALUE", * blobValue: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") * arrayValue: { // ArrayValue Union: only one key present * booleanValues: [ // BooleanArray * true || false, * ], * longValues: [ // LongArray * Number("long"), * ], * doubleValues: [ // DoubleArray * Number("double"), * ], * stringValues: [ // StringArray * "STRING_VALUE", * ], * arrayValues: [ // ArrayOfArray * {// Union: only one key present * booleanValues: [ * true || false, * ], * longValues: [ * Number("long"), * ], * doubleValues: [ * Number("double"), * ], * stringValues: [ * "STRING_VALUE", * ], * arrayValues: [ * "", * ], * }, * ], * }, * }, * typeHint: "STRING_VALUE", * }, * ], * transactionId: "STRING_VALUE", * includeResultMetadata: true || false, * continueAfterTimeout: true || false, * resultSetOptions: { // ResultSetOptions * decimalReturnType: "STRING_VALUE", * longReturnType: "STRING_VALUE", * }, * formatRecordsAs: "STRING_VALUE", * }; * const command = new ExecuteStatementCommand(input); * const response = await client.send(command); * // { // ExecuteStatementResponse * // records: [ // SqlRecords * // [ // FieldList * // { // Field Union: only one key present * // isNull: true || false, * // booleanValue: true || false, * // longValue: Number("long"), * // doubleValue: Number("double"), * // stringValue: "STRING_VALUE", * // blobValue: new Uint8Array(), * // arrayValue: { // ArrayValue Union: only one key present * // booleanValues: [ // BooleanArray * // true || false, * // ], * // longValues: [ // LongArray * // Number("long"), * // ], * // doubleValues: [ // DoubleArray * // Number("double"), * // ], * // stringValues: [ // StringArray * // "STRING_VALUE", * // ], * // arrayValues: [ // ArrayOfArray * // {// Union: only one key present * // booleanValues: [ * // true || false, * // ], * // longValues: [ * // Number("long"), * // ], * // doubleValues: [ * // Number("double"), * // ], * // stringValues: [ * // "STRING_VALUE", * // ], * // arrayValues: [ * // "", * // ], * // }, * // ], * // }, * // }, * // ], * // ], * // columnMetadata: [ // Metadata * // { // ColumnMetadata * // name: "STRING_VALUE", * // type: Number("int"), * // typeName: "STRING_VALUE", * // label: "STRING_VALUE", * // schemaName: "STRING_VALUE", * // tableName: "STRING_VALUE", * // isAutoIncrement: true || false, * // isSigned: true || false, * // isCurrency: true || false, * // isCaseSensitive: true || false, * // nullable: Number("int"), * // precision: Number("int"), * // scale: Number("int"), * // arrayBaseColumnType: Number("int"), * // }, * // ], * // numberOfRecordsUpdated: Number("long"), * // generatedFields: [ * // {// Union: only one key present * // isNull: true || false, * // booleanValue: true || false, * // longValue: Number("long"), * // doubleValue: Number("double"), * // stringValue: "STRING_VALUE", * // blobValue: new Uint8Array(), * // arrayValue: "", * // }, * // ], * // formattedRecords: "STRING_VALUE", * // }; * * ``` * * @param ExecuteStatementCommandInput - {@link ExecuteStatementCommandInput} * @returns {@link ExecuteStatementCommandOutput} * @see {@link ExecuteStatementCommandInput} for command's `input` shape. * @see {@link ExecuteStatementCommandOutput} for command's `response` shape. * @see {@link RDSDataClientResolvedConfig | config} for RDSDataClient's `config` shape. * * @throws {@link AccessDeniedException} (client fault) *

You don't have sufficient access to perform this action.

* * @throws {@link BadRequestException} (client fault) *

There is an error in the call or in a SQL statement. (This error only appears in calls from Aurora Serverless v1 databases.)

* * @throws {@link DatabaseErrorException} (client fault) *

There was an error in processing the SQL statement.

* * @throws {@link DatabaseNotFoundException} (client fault) *

The DB cluster doesn't have a DB instance.

* * @throws {@link DatabaseResumingException} (client fault) *

A request was cancelled because the Aurora Serverless v2 DB instance was paused. * The Data API request automatically resumes the DB instance. Wait a few seconds and * try again.

* * @throws {@link DatabaseUnavailableException} (server fault) *

The writer instance in the DB cluster isn't available.

* * @throws {@link ForbiddenException} (client fault) *

There are insufficient privileges to make the call.

* * @throws {@link HttpEndpointNotEnabledException} (client fault) *

The HTTP endpoint for using RDS Data API isn't enabled for the DB cluster.

* * @throws {@link InternalServerErrorException} (server fault) *

An internal error occurred.

* * @throws {@link InvalidResourceStateException} (client fault) *

The resource is in an invalid state.

* * @throws {@link InvalidSecretException} (client fault) *

The Secrets Manager secret used with the request isn't valid.

* * @throws {@link SecretsErrorException} (client fault) *

There was a problem with the Secrets Manager secret used with the request, caused by one of the following conditions:

*
    *
  • *

    RDS Data API timed out retrieving the secret.

    *
  • *
  • *

    The secret provided wasn't found.

    *
  • *
  • *

    The secret couldn't be decrypted.

    *
  • *
* * @throws {@link ServiceUnavailableError} (server fault) *

The service specified by the resourceArn parameter isn't * available.

* * @throws {@link StatementTimeoutException} (client fault) *

The execution of the SQL statement timed out.

* * @throws {@link TransactionNotFoundException} (client fault) *

The transaction ID wasn't found.

* * @throws {@link UnsupportedResultException} (client fault) *

There was a problem with the result because of one of the following conditions:

*
    *
  • *

    It contained an unsupported data type.

    *
  • *
  • *

    It contained a multidimensional array.

    *
  • *
  • *

    The size was too large.

    *
  • *
* * @throws {@link RDSDataServiceException} *

Base exception class for all service exceptions from RDSData service.

* * * @public */ export declare class ExecuteStatementCommand extends ExecuteStatementCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: ExecuteStatementRequest; output: ExecuteStatementResponse; }; sdk: { input: ExecuteStatementCommandInput; output: ExecuteStatementCommandOutput; }; }; }