UpdateDatabaseCommand

Updates an existing database definition in a Data Catalog.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { GlueClient, UpdateDatabaseCommand } from "@aws-sdk/client-glue"; // ES Modules import
// const { GlueClient, UpdateDatabaseCommand } = require("@aws-sdk/client-glue"); // CommonJS import
const client = new GlueClient(config);
const input = { // UpdateDatabaseRequest
  CatalogId: "STRING_VALUE",
  Name: "STRING_VALUE", // required
  DatabaseInput: { // DatabaseInput
    Name: "STRING_VALUE", // required
    Description: "STRING_VALUE",
    LocationUri: "STRING_VALUE",
    Parameters: { // ParametersMap
      "<keys>": "STRING_VALUE",
    },
    CreateTableDefaultPermissions: [ // PrincipalPermissionsList
      { // PrincipalPermissions
        Principal: { // DataLakePrincipal
          DataLakePrincipalIdentifier: "STRING_VALUE",
        },
        Permissions: [ // PermissionList
          "ALL" || "SELECT" || "ALTER" || "DROP" || "DELETE" || "INSERT" || "CREATE_DATABASE" || "CREATE_TABLE" || "DATA_LOCATION_ACCESS",
        ],
      },
    ],
    TargetDatabase: { // DatabaseIdentifier
      CatalogId: "STRING_VALUE",
      DatabaseName: "STRING_VALUE",
      Region: "STRING_VALUE",
    },
    FederatedDatabase: { // FederatedDatabase
      Identifier: "STRING_VALUE",
      ConnectionName: "STRING_VALUE",
    },
  },
};
const command = new UpdateDatabaseCommand(input);
const response = await client.send(command);
// {};

UpdateDatabaseCommand Input

See UpdateDatabaseCommandInput for more details

Parameter
Type
Description
DatabaseInput
Required
DatabaseInput | undefined

A DatabaseInput object specifying the new definition of the metadata database in the catalog.

Name
Required
string | undefined

The name of the database to update in the catalog. For Hive compatibility, this is folded to lowercase.

CatalogId
string | undefined

The ID of the Data Catalog in which the metadata database resides. If none is provided, the Amazon Web Services account ID is used by default.

UpdateDatabaseCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
AlreadyExistsException
client

A resource to be created or added already exists.

ConcurrentModificationException
client

Two processes are trying to modify a resource simultaneously.

EntityNotFoundException
client

A specified entity does not exist

FederationSourceException
client

A federation source failed.

FederationSourceRetryableException
client

A federation source failed, but the operation may be retried.

GlueEncryptionException
client

An encryption operation failed.

InternalServiceException
server

An internal service error occurred.

InvalidInputException
client

The input provided was not valid.

OperationTimeoutException
client

The operation timed out.

GlueServiceException
Base exception class for all service exceptions from Glue service.