amazonka-redshift-data-2.0: Amazon Redshift Data API Service SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.RedshiftData.ExecuteStatement

Description

Runs an SQL statement, which can be data manipulation language (DML) or data definition language (DDL). This statement must be a single SQL statement. Depending on the authorization method, use one of the following combinations of request parameters:

  • Secrets Manager - when connecting to a cluster, specify the Amazon Resource Name (ARN) of the secret, the database name, and the cluster identifier that matches the cluster in the secret. When connecting to a serverless workgroup, specify the Amazon Resource Name (ARN) of the secret and the database name.
  • Temporary credentials - when connecting to a cluster, specify the cluster identifier, the database name, and the database user name. Also, permission to call the redshift:GetClusterCredentials operation is required. When connecting to a serverless workgroup, specify the workgroup name and database name. Also, permission to call the redshift-serverless:GetCredentials operation is required.

For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.

Synopsis

Creating a Request

data ExecuteStatement Source #

See: newExecuteStatement smart constructor.

Constructors

ExecuteStatement' 

Fields

  • clientToken :: Maybe Text

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

  • clusterIdentifier :: Maybe Text

    The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.

  • dbUser :: Maybe Text

    The database user name. This parameter is required when connecting to a cluster and authenticating using temporary credentials.

  • parameters :: Maybe (NonEmpty SqlParameter)

    The parameters for the SQL statement.

  • secretArn :: Maybe Text

    The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.

  • statementName :: Maybe Text

    The name of the SQL statement. You can name the SQL statement when you create it to identify the query.

  • withEvent :: Maybe Bool

    A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.

  • workgroupName :: Maybe Text

    The serverless workgroup name. This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.

  • database :: Text

    The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.

  • sql :: Text

    The SQL statement text to run.

Instances

Instances details
ToJSON ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

ToHeaders ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

ToPath ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

ToQuery ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

AWSRequest ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Associated Types

type AWSResponse ExecuteStatement #

Generic ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Associated Types

type Rep ExecuteStatement :: Type -> Type #

Read ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Show ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

NFData ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Methods

rnf :: ExecuteStatement -> () #

Eq ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Hashable ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

type AWSResponse ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

type Rep ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.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:clientToken:ExecuteStatement', executeStatement_clientToken - A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

ExecuteStatement, executeStatement_clusterIdentifier - The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.

ExecuteStatement, executeStatement_dbUser - The database user name. This parameter is required when connecting to a cluster and authenticating using temporary credentials.

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

ExecuteStatement, executeStatement_secretArn - The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.

ExecuteStatement, executeStatement_statementName - The name of the SQL statement. You can name the SQL statement when you create it to identify the query.

$sel:withEvent:ExecuteStatement', executeStatement_withEvent - A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.

ExecuteStatement, executeStatement_workgroupName - The serverless workgroup name. This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.

ExecuteStatement, executeStatement_database - The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.

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

Request Lenses

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

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

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

The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.

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

The database user name. This parameter is required when connecting to a cluster and authenticating using temporary credentials.

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

The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.

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

The name of the SQL statement. You can name the SQL statement when you create it to identify the query.

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

A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.

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

The serverless workgroup name. This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.

executeStatement_database :: Lens' ExecuteStatement Text Source #

The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.

executeStatement_sql :: Lens' ExecuteStatement Text Source #

The SQL statement text to run.

Destructuring the Response

data ExecuteStatementResponse Source #

See: newExecuteStatementResponse smart constructor.

Constructors

ExecuteStatementResponse' 

Fields

  • clusterIdentifier :: Maybe Text

    The cluster identifier. This element is not returned when connecting to a serverless workgroup.

  • createdAt :: Maybe POSIX

    The date and time (UTC) the statement was created.

  • database :: Maybe Text

    The name of the database.

  • dbUser :: Maybe Text

    The database user name.

  • id :: Maybe Text

    The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.

  • secretArn :: Maybe Text

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

  • workgroupName :: Maybe Text

    The serverless workgroup name. This element is not returned when connecting to a provisioned cluster.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Associated Types

type Rep ExecuteStatementResponse :: Type -> Type #

Read ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Show ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

NFData ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Eq ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

type Rep ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

type Rep ExecuteStatementResponse = D1 ('MetaData "ExecuteStatementResponse" "Amazonka.RedshiftData.ExecuteStatement" "amazonka-redshift-data-2.0-Hy9KEgtH5Bc3altuyuPuYo" 'False) (C1 ('MetaCons "ExecuteStatementResponse'" 'PrefixI 'True) (((S1 ('MetaSel ('Just "clusterIdentifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "createdAt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX))) :*: (S1 ('MetaSel ('Just "database") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "dbUser") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "secretArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "workgroupName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: 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:

ExecuteStatement, executeStatementResponse_clusterIdentifier - The cluster identifier. This element is not returned when connecting to a serverless workgroup.

ExecuteStatementResponse, executeStatementResponse_createdAt - The date and time (UTC) the statement was created.

ExecuteStatement, executeStatementResponse_database - The name of the database.

ExecuteStatement, executeStatementResponse_dbUser - The database user name.

ExecuteStatementResponse, executeStatementResponse_id - The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.

ExecuteStatement, executeStatementResponse_secretArn - The name or ARN of the secret that enables access to the database.

ExecuteStatement, executeStatementResponse_workgroupName - The serverless workgroup name. This element is not returned when connecting to a provisioned cluster.

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

Response Lenses

executeStatementResponse_clusterIdentifier :: Lens' ExecuteStatementResponse (Maybe Text) Source #

The cluster identifier. This element is not returned when connecting to a serverless workgroup.

executeStatementResponse_createdAt :: Lens' ExecuteStatementResponse (Maybe UTCTime) Source #

The date and time (UTC) the statement was created.

executeStatementResponse_id :: Lens' ExecuteStatementResponse (Maybe Text) Source #

The identifier of the SQL statement whose results are to be fetched. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.

executeStatementResponse_secretArn :: Lens' ExecuteStatementResponse (Maybe Text) Source #

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

executeStatementResponse_workgroupName :: Lens' ExecuteStatementResponse (Maybe Text) Source #

The serverless workgroup name. This element is not returned when connecting to a provisioned cluster.