pub fn hint(&self) -> Option<String> {
        match self {
            CoordError::AutomaticTimestampFailure {
                unmaterialized,
                disabled_indexes,
            } => {
                let unmaterialized_hint = if unmaterialized.is_empty() {
                    ""
                } else {
                    "\n- Use `SELECT ... AS OF` to manually choose a timestamp for your query.
- Create indexes on the listed unmaterialized sources or on the views derived from those sources"
                };
                let disabled_indexes_hint = if disabled_indexes.is_empty() {
                    ""
                } else {
                    "ALTER INDEX ... SET ENABLED to enable indexes"
                };

                Some(format!(
                    "{}{}{}",
                    unmaterialized_hint,
                    if !unmaterialized_hint.is_empty() {
                        "\n-"
                    } else {
                        ""
                    },
                    disabled_indexes_hint
                ))
            }
            CoordError::Catalog(c) => c.hint(),
            CoordError::ConstrainedParameter { valid_values, .. } => {
                Some(format!("Available values: {}.", valid_values.join(", ")))
            }
            CoordError::Eval(e) => e.hint(),
            CoordError::InvalidAlterOnDisabledIndex(idx) => Some(format!(
                "To perform this ALTER, first enable the index using ALTER \
                INDEX {} SET ENABLED",
                idx.quoted()
            )),
            CoordError::UnknownLoginRole(_) => {
                // TODO(benesch): this will be a bad hint when people are used
                // to creating roles in Materialize, since they might drop the
                // default "materialize" role. Remove it in a few months
                // (say, April 2021) when folks are more used to using roles
                // with Materialize. (We don't want to do something more clever
                // and include the actual roles that exist in the message,
                // because that leaks information to unauthenticated clients.)
                Some("Try connecting as the \"materialize\" user.".into())
            }
            CoordError::InvalidRematerialization { source_type, .. } => {
                let doc_page = match source_type {
                    RematerializedSourceType::Postgres => "postgres",
                    RematerializedSourceType::S3 => "text-s3",
                    RematerializedSourceType::PersistedSource => {
                        // TODO: Make this more helpful once we have documentation for persisted
                        // sources.
                        return Some(
                            "Either create one materialization and base more views on that, or create another source to base this materialization upon.".to_string(),
                        );
                    }
                };
                Some(format!(
                    "See the documentation at https://materialize.com/docs/sql/create-source/{}",
                    doc_page
                ))
            }
            _ => None,
        }
    }
/// Reports a hint for the user about how the error could be fixed.
Reports a hint for the user about how the error could be fixed.
Reports a hint for the user about how the error could be fixed .
pub fn hint(&self) -> Option<String> {
        match self {
            CoordError::AutomaticTimestampFailure {
                unmaterialized,
                disabled_indexes,
            } => {
                let unmaterialized_hint = if unmaterialized.is_empty() {
                    ""
                } else {
                    "\n- Use `SELECT ... AS OF` to manually choose a timestamp for your query.
- Create indexes on the listed unmaterialized sources or on the views derived from those sources"
                };
                let disabled_indexes_hint = if disabled_indexes.is_empty() {
                    ""
                } else {
                    "ALTER INDEX ... SET ENABLED to enable indexes"
                };
                Some(format!(
                    "{}{}{}",
                    unmaterialized_hint,
                    if !unmaterialized_hint.is_empty() {
                        "\n-"
                    } else {
                        ""
                    },
                    disabled_indexes_hint
                ))
            }
            CoordError::Catalog(c) => c.hint(),
            CoordError::ConstrainedParameter { valid_values, .. } => {
                Some(format!("Available values: {}.", valid_values.join(", ")))
            }
            CoordError::Eval(e) => e.hint(),
            CoordError::InvalidAlterOnDisabledIndex(idx) => Some(format!(
                "To perform this ALTER, first enable the index using ALTER \
                INDEX {} SET ENABLED",
                idx.quoted()
            )),
            CoordError::UnknownLoginRole(_) => {
                // TODO(benesch): this will be a bad hint when people are used
                // to creating roles in Materialize, since they might drop the
                // default "materialize" role. Remove it in a few months
                // (say, April 2021) when folks are more used to using roles
                // with Materialize. (We don't want to do something more clever
                // and include the actual roles that exist in the message,
                // because that leaks information to unauthenticated clients.)
                Some("Try connecting as the \"materialize\" user.".into())
            }
            CoordError::InvalidRematerialization { source_type, .. } => {
                let doc_page = match source_type {
                    RematerializedSourceType::Postgres => "postgres",
                    RematerializedSourceType::S3 => "text-s3",
                    RematerializedSourceType::PersistedSource => {
                        // TODO: Make this more helpful once we have documentation for persisted
                        // sources.
                        return Some(
                            "Either create one materialization and base more views on that, or create another source to base this materialization upon.".to_string(),
                        );
                    }
                };
                Some(format!(
                    "See the documentation at https://materialize.com/docs/sql/create-source/{}",
                    doc_page
                ))
            }
            _ => None,
        }
    }
pub fn hint ( & self ) -> Option < String > { match self { CoordError :: AutomaticTimestampFailure { unmaterialized , disabled_indexes , } => { let unmaterialized_hint = if unmaterialized . is_empty ( ) { " " } else { " \n " } ; let disabled_indexes_hint = if disabled_indexes . is_empty ( ) { " " } else { " " } ; Some ( format ! ( " " unmaterialized_hint if unmaterialized_hint is_empty ( ) { " \n " } else { " " } disabled_indexes_hint ) ) } CoordError :: Catalog ( c ) => c . hint ( ) , CoordError :: ConstrainedParameter { valid_values , .. } => { Some ( format ! ( " " valid_values join ( " " ) ) ) } CoordError :: Eval ( e ) => e . hint ( ) , CoordError :: InvalidAlterOnDisabledIndex ( idx ) => Some ( format ! ( " \
 " idx quoted ( ) ) ) , CoordError :: UnknownLoginRole ( _ ) => { // TODO(benesch): this will be a bad hint when people are used // to creating roles in Materialize, since they might drop the // default "materialize" role. Remove it in a few months // (say, April 2021) when folks are more used to using roles // with Materialize. (We don't want to do something more clever // and include the actual roles that exist in the message, // because that leaks information to unauthenticated clients.) Some ( " \" \" " . into ( ) ) } CoordError :: InvalidRematerialization { source_type , .. } => { let doc_page = match source_type { RematerializedSourceType :: Postgres => " " , RematerializedSourceType :: S3 => " " , RematerializedSourceType :: PersistedSource => { // TODO: Make this more helpful once we have documentation for persisted // sources. return Some ( " " . to_string ( ) , ) ; } } ; Some ( format ! ( " " doc_page ) ) } _ => None , } }
Reports a hint for the user about how the error could be fixed.
Reports a hint for the user about how the error could be fixed .
&self