libZSservicesZSamazonka-redshift-dataZSamazonka-redshift-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.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 - specify the Amazon Resource Name (ARN) of the secret, the database name, and the cluster identifier that matches the cluster in the secret.
  • Temporary credentials - specify the cluster identifier, the database name, and the database user name. Permission to call the redshift:GetClusterCredentials operation is required to use this method.
Synopsis

Creating a Request

data ExecuteStatement Source #

See: newExecuteStatement smart constructor.

Constructors

ExecuteStatement' 

Fields

  • dbUser :: Maybe Text

    The database user name. This parameter is required when authenticating using temporary credentials.

  • statementName :: Maybe Text

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

  • 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.

  • withEvent :: Maybe Bool

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

  • clusterIdentifier :: Text

    The cluster identifier. This parameter is required when 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
Eq ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Read ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Show ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Generic ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Associated Types

type Rep ExecuteStatement :: Type -> Type #

NFData ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Methods

rnf :: ExecuteStatement -> () #

Hashable ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

ToJSON ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

AWSRequest ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Associated Types

type AWSResponse 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

type Rep ExecuteStatement Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

type AWSResponse 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:dbUser:ExecuteStatement', executeStatement_dbUser - The database user name. This parameter is required when authenticating using temporary credentials.

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

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

$sel:secretArn: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.

$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.

$sel:clusterIdentifier:ExecuteStatement', executeStatement_clusterIdentifier - The cluster identifier. This parameter is required when authenticating using either Secrets Manager or temporary credentials.

$sel:database: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_dbUser :: Lens' ExecuteStatement (Maybe Text) Source #

The database user name. This parameter is required when authenticating using temporary credentials.

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_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_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_clusterIdentifier :: Lens' ExecuteStatement Text Source #

The cluster identifier. This parameter is required when 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

Instances

Instances details
Eq ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Read ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Show ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Generic ExecuteStatementResponse Source # 
Instance details

Defined in Amazonka.RedshiftData.ExecuteStatement

Associated Types

type Rep ExecuteStatementResponse :: Type -> Type #

NFData 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" "libZSservicesZSamazonka-redshift-dataZSamazonka-redshift-data" 'False) (C1 ('MetaCons "ExecuteStatementResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "dbUser") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "database") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "createdAt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX)))) :*: ((S1 ('MetaSel ('Just "clusterIdentifier") '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 "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:dbUser:ExecuteStatement', executeStatementResponse_dbUser - The database user name.

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

$sel:createdAt:ExecuteStatementResponse', executeStatementResponse_createdAt - The date and time (UTC) the statement was created.

$sel:clusterIdentifier:ExecuteStatement', executeStatementResponse_clusterIdentifier - The cluster identifier.

$sel:id: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.

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

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

Response Lenses

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.