pub async fn create_database(&self, rules: DatabaseRules) -> Result<()> {
        // Return an error if this server is not yet ready
        let server_id = self.require_initialized()?;

        let preserved_catalog = load_or_create_preserved_catalog(
            rules.db_name(),
            Arc::clone(&self.store),
            server_id,
            self.config.metrics_registry(),
        )
        .await
        .map_err(|e| Box::new(e) as _)
        .context(CatalogLoadError)?;

        let db_reservation = self.config.create_db(rules)?;
        self.persist_database_rules(db_reservation.rules().clone())
            .await?;
        db_reservation.commit(
            server_id,
            Arc::clone(&self.store),
            Arc::clone(&self.exec),
            preserved_catalog,
        );

        Ok(())
    }
/// Tells the server the set of rules for a database.
Tells the server the set of rules for a database.
Tells the server the set of rules for a database .
pub async fn create_database(&self, rules: DatabaseRules) -> Result<()> {
        // Return an error if this server is not yet ready
        let server_id = self.require_initialized()?;
        let preserved_catalog = load_or_create_preserved_catalog(
            rules.db_name(),
            Arc::clone(&self.store),
            server_id,
            self.config.metrics_registry(),
        )
        .await
        .map_err(|e| Box::new(e) as _)
        .context(CatalogLoadError)?;
        let db_reservation = self.config.create_db(rules)?;
        self.persist_database_rules(db_reservation.rules().clone())
            .await?;
        db_reservation.commit(
            server_id,
            Arc::clone(&self.store),
            Arc::clone(&self.exec),
            preserved_catalog,
        );
        Ok(())
    }
pub async fn create_database ( & self , rules : DatabaseRules ) -> Result < ( ) > { // Return an error if this server is not yet ready let server_id = self . require_initialized ( ) ? ; let preserved_catalog = load_or_create_preserved_catalog ( rules . db_name ( ) , Arc :: clone ( & self . store ) , server_id , self . config . metrics_registry ( ) , ) . await . map_err ( | e | Box :: new ( e ) as _ ) . context ( CatalogLoadError ) ? ; let db_reservation = self . config . create_db ( rules ) ? ; self . persist_database_rules ( db_reservation . rules ( ) . clone ( ) ) . await ? ; db_reservation . commit ( server_id , Arc :: clone ( & self . store ) , Arc :: clone ( & self . exec ) , preserved_catalog , ) ; Ok ( ( ) ) }
Tells the server the set of rules for a database.
Tells the server the set of rules for a database .
&self
rules
DatabaseRules
&self
rules
DatabaseRules