Skip to content

get_database

get_database(
    name: NameString,
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    catalog_id: Optional[CatalogIdString] = None,
) -> GetDatabaseResponse

Retrieves the definition of a specified database.

Parameters:

  • catalog_id (Optional[CatalogIdString], default: None ) –

    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.

  • name (NameString) –

    The name of the database to retrieve. For Hive compatibility, this should be all lowercase.

Raises:

Source code in docs_src/capo_glue/_services/glue.py
def get_database(
    self,
    name: "capo_glue.types.name_string.NameString",
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    catalog_id: Optional[
        "capo_glue.types.catalog_id_string.CatalogIdString"
    ] = None,
) -> "capo_glue.types.get_database_response.GetDatabaseResponse":
    """<p>Retrieves the definition of a specified database.</p>

    Args:
        catalog_id: <p>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.</p>
        name: <p>The name of the database to retrieve. For Hive compatibility, this should be all lowercase.</p>

    Raises:
        capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</p>
        capo_glue.errors.federation_source_exception.FederationSourceException: <p>A federation source failed.</p>
        capo_glue.errors.federation_source_retryable_exception.FederationSourceRetryableException: <p>A federation source failed, but the operation may be retried.</p>
        capo_glue.errors.glue_encryption_exception.GlueEncryptionException: <p>An encryption operation failed.</p>
        capo_glue.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_glue.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_glue.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_glue.types.get_database_request.GetDatabaseRequest]",
    ) -> OperationResponse[
        "capo_glue.types.get_database_response.GetDatabaseResponse"
    ]:
        import capo_glue._operations.aws_glue.get_database

        output, http_response = (
            capo_glue._operations.aws_glue.get_database.get_database(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetDatabase")
    )
    input_: capo_glue.types.get_database_request.GetDatabaseRequest = {"name": name}
    if catalog_id is not None:
        input_["catalog_id"] = catalog_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output