- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
GetDatabaseCommand
Retrieves the definition of a specified database.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { GlueClient, GetDatabaseCommand } from "@aws-sdk/client-glue"; // ES Modules import
// const { GlueClient, GetDatabaseCommand } = require("@aws-sdk/client-glue"); // CommonJS import
const client = new GlueClient(config);
const input = { // GetDatabaseRequest
CatalogId: "STRING_VALUE",
Name: "STRING_VALUE", // required
};
const command = new GetDatabaseCommand(input);
const response = await client.send(command);
// { // GetDatabaseResponse
// Database: { // Database
// Name: "STRING_VALUE", // required
// Description: "STRING_VALUE",
// LocationUri: "STRING_VALUE",
// Parameters: { // ParametersMap
// "<keys>": "STRING_VALUE",
// },
// CreateTime: new Date("TIMESTAMP"),
// 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",
// },
// CatalogId: "STRING_VALUE",
// FederatedDatabase: { // FederatedDatabase
// Identifier: "STRING_VALUE",
// ConnectionName: "STRING_VALUE",
// },
// },
// };
GetDatabaseCommand Input
See GetDatabaseCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
Name Required | string | undefined | The name of the database to retrieve. For Hive compatibility, this should be all lowercase. |
CatalogId | string | undefined | The ID of the Data Catalog in which the database resides. If none is provided, the Amazon Web Services account ID is used by default. |
GetDatabaseCommand Output
See GetDatabaseCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Database | Database | undefined | The definition of the specified database in the Data Catalog. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
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. |