libZSservicesZSamazonka-rds-dataZSamazonka-rds-data
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.RDSData.ExecuteStatement

Description

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.

The response size limit is 1 MB. If the call returns more than 1 MB of response data, the call is terminated.

Synopsis

Creating a Request

data ExecuteStatement Source #

The request parameters represent the input of a request to run a SQL statement against a database.

See: newExecuteStatement smart constructor.

Constructors

ExecuteStatement' 

Fields

  • database :: Maybe Text

    The name of the database.

  • transactionId :: Maybe Text

    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.

  • schema :: Maybe Text

    The name of the database schema.

    Currently, the schema parameter isn't supported.

  • parameters :: Maybe [SqlParameter]

    The parameters for the SQL statement.

    Array parameters are not supported.

  • includeResultMetadata :: Maybe Bool

    A value that indicates whether to include metadata in the results.

  • resultSetOptions :: Maybe ResultSetOptions

    Options that control how the result set is returned.

  • continueAfterTimeout :: Maybe Bool

    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.

    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.

  • resourceArn :: Text

    The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.

  • secretArn :: Text

    The name or ARN of the secret that enables access to the DB cluster.

  • sql :: Text

    The SQL statement to run.

Instances

Instances details
Eq ExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

Read ExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

Show ExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

Generic ExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

Associated Types

type Rep ExecuteStatement :: Type -> Type #

NFData ExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

Methods

rnf :: ExecuteStatement -> () #

Hashable ExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

ToJSON ExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

AWSRequest ExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

Associated Types

type AWSResponse ExecuteStatement #

ToHeaders ExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

ToPath ExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

ToQuery ExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

type Rep ExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

type AWSResponse ExecuteStatement Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

newExecuteStatement Source #

Create a value of ExecuteStatement with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:database:ExecuteStatement', executeStatement_database - The name of the database.

$sel:transactionId:ExecuteStatement', executeStatement_transactionId - 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.

$sel:schema:ExecuteStatement', executeStatement_schema - The name of the database schema.

Currently, the schema parameter isn't supported.

$sel:parameters:ExecuteStatement', executeStatement_parameters - The parameters for the SQL statement.

Array parameters are not supported.

$sel:includeResultMetadata:ExecuteStatement', executeStatement_includeResultMetadata - A value that indicates whether to include metadata in the results.

$sel:resultSetOptions:ExecuteStatement', executeStatement_resultSetOptions - Options that control how the result set is returned.

$sel:continueAfterTimeout:ExecuteStatement', executeStatement_continueAfterTimeout - 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.

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.

$sel:resourceArn:ExecuteStatement', executeStatement_resourceArn - The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.

$sel:secretArn:ExecuteStatement', executeStatement_secretArn - The name or ARN of the secret that enables access to the DB cluster.

$sel:sql:ExecuteStatement', executeStatement_sql - The SQL statement to run.

Request Lenses

executeStatement_transactionId :: Lens' ExecuteStatement (Maybe Text) Source #

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.

executeStatement_schema :: Lens' ExecuteStatement (Maybe Text) Source #

The name of the database schema.

Currently, the schema parameter isn't supported.

executeStatement_parameters :: Lens' ExecuteStatement (Maybe [SqlParameter]) Source #

The parameters for the SQL statement.

Array parameters are not supported.

executeStatement_includeResultMetadata :: Lens' ExecuteStatement (Maybe Bool) Source #

A value that indicates whether to include metadata in the results.

executeStatement_resultSetOptions :: Lens' ExecuteStatement (Maybe ResultSetOptions) Source #

Options that control how the result set is returned.

executeStatement_continueAfterTimeout :: Lens' ExecuteStatement (Maybe Bool) Source #

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.

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.

executeStatement_resourceArn :: Lens' ExecuteStatement Text Source #

The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.

executeStatement_secretArn :: Lens' ExecuteStatement Text Source #

The name or ARN of the secret that enables access to the DB cluster.

Destructuring the Response

data ExecuteStatementResponse Source #

The response elements represent the output of a request to run a SQL statement against a database.

See: newExecuteStatementResponse smart constructor.

Constructors

ExecuteStatementResponse' 

Fields

  • records :: Maybe [[Field]]

    The records returned by the SQL statement.

  • columnMetadata :: Maybe [ColumnMetadata]

    Metadata for the columns included in the results.

  • generatedFields :: Maybe [Field]

    Values for fields generated during the request.

     <note> <p>The <code>generatedFields</code> data isn't supported by Aurora PostgreSQL. To get the values of generated fields, use the <code>RETURNING</code> clause. For more information, see <a href="https://www.postgresql.org/docs/10/dml-returning.html">Returning Data From Modified Rows</a> in the PostgreSQL documentation.</p> </note>
  • numberOfRecordsUpdated :: Maybe Integer

    The number of records updated by the request.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Eq ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

Read ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

Show ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

Generic ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

Associated Types

type Rep ExecuteStatementResponse :: Type -> Type #

NFData ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

type Rep ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RDSData.ExecuteStatement

type Rep ExecuteStatementResponse = D1 ('MetaData "ExecuteStatementResponse" "Amazonka.RDSData.ExecuteStatement" "libZSservicesZSamazonka-rds-dataZSamazonka-rds-data" 'False) (C1 ('MetaCons "ExecuteStatementResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "records") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [[Field]])) :*: S1 ('MetaSel ('Just "columnMetadata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [ColumnMetadata]))) :*: (S1 ('MetaSel ('Just "generatedFields") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Field])) :*: (S1 ('MetaSel ('Just "numberOfRecordsUpdated") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Integer)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))))

newExecuteStatementResponse Source #

Create a value of ExecuteStatementResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:records:ExecuteStatementResponse', executeStatementResponse_records - The records returned by the SQL statement.

$sel:columnMetadata:ExecuteStatementResponse', executeStatementResponse_columnMetadata - Metadata for the columns included in the results.

$sel:generatedFields:ExecuteStatementResponse', executeStatementResponse_generatedFields - Values for fields generated during the request.

 <note> <p>The <code>generatedFields</code> data isn't supported by Aurora PostgreSQL. To get the values of generated fields, use the <code>RETURNING</code> clause. For more information, see <a href="https://www.postgresql.org/docs/10/dml-returning.html">Returning Data From Modified Rows</a> in the PostgreSQL documentation.</p> </note>

$sel:numberOfRecordsUpdated:ExecuteStatementResponse', executeStatementResponse_numberOfRecordsUpdated - The number of records updated by the request.

$sel:httpStatus:ExecuteStatementResponse', executeStatementResponse_httpStatus - The response's http status code.

Response Lenses

executeStatementResponse_records :: Lens' ExecuteStatementResponse (Maybe [[Field]]) Source #

The records returned by the SQL statement.

executeStatementResponse_generatedFields :: Lens' ExecuteStatementResponse (Maybe [Field]) Source #

Values for fields generated during the request.

 <note> <p>The <code>generatedFields</code> data isn't supported by Aurora PostgreSQL. To get the values of generated fields, use the <code>RETURNING</code> clause. For more information, see <a href="https://www.postgresql.org/docs/10/dml-returning.html">Returning Data From Modified Rows</a> in the PostgreSQL documentation.</p> </note>