Skip to content

update_database async

update_database(
    name: NameString,
    database_input: DatabaseInput,
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    catalog_id: Optional[CatalogIdString] = None,
) -> UpdateDatabaseResponse

Updates an existing database definition in a Data Catalog.

Parameters:

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

    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.

  • name (NameString) –

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

  • database_input (DatabaseInput) –

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

Raises:

Source code in docs_src/capo_glue/_services/async_glue.py
async def update_database(
    self,
    name: "capo_glue.types.name_string.NameString",
    database_input: "capo_glue.types.database_input.DatabaseInput",
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    catalog_id: Optional[
        "capo_glue.types.catalog_id_string.CatalogIdString"
    ] = None,
) -> "capo_glue.types.update_database_response.UpdateDatabaseResponse":
    """<p>Updates an existing database definition in a Data Catalog.</p>

    Args:
        catalog_id: <p>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.</p>
        name: <p>The name of the database to update in the catalog. For Hive compatibility, this is folded to lowercase.</p>
        database_input: <p>A <code>DatabaseInput</code> object specifying the new definition of the metadata database in the catalog.</p>

    Raises:
        capo_glue.errors.already_exists_exception.AlreadyExistsException: <p>A resource to be created or added already exists.</p>
        capo_glue.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Two processes are trying to modify a resource simultaneously.</p>
        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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_glue.types.update_database_request.UpdateDatabaseRequest]",
    ) -> AsyncOperationResponse[
        "capo_glue.types.update_database_response.UpdateDatabaseResponse"
    ]:
        import capo_glue._operations.aws_glue.update_database

        (
            output,
            http_response,
        ) = await capo_glue._operations.aws_glue.update_database.async_update_database(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDatabase")
    )
    input_: capo_glue.types.update_database_request.UpdateDatabaseRequest = {
        "name": name,
        "database_input": database_input,
    }
    if catalog_id is not None:
        input_["catalog_id"] = catalog_id

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output