Interface AccessTools


  • public interface AccessTools
    A set of basic Snowflake access tools.
    • Method Detail

      • hasWarehouseAccess

        boolean hasWarehouseAccess​(Identifier warehouse)
        Returns whether the application has access to the specified warehouse.

        It is assumed, that if the SHOW WAREHOUSES query returns the specified warehouse - the application has access to it.

        Parameters:
        warehouse - warehouse identifier
        Returns:
        whether the application has access to the specified warehouse
      • hasDatabaseAccess

        boolean hasDatabaseAccess​(Identifier database)
        Returns whether the application has access to the specified database.

        It is assumed, that if the SHOW DATABASES query returns the specified database - the application has access to it.

        Parameters:
        database - database identifier
        Returns:
        whether the application has access to the specified schema
      • hasSchemaAccess

        boolean hasSchemaAccess​(SchemaName schemaName)
        Returns whether the application has access to the specified schema in the specified database.

        It is assumed, that if the SHOW SCHEMAS query returns the specified schema - the application has access to it.

        Parameters:
        schemaName - schema name identifier
        Returns:
        whether the application has access to the specified schema in the specified database
      • hasSecretAccess

        boolean hasSecretAccess​(ObjectName secret)
        Returns whether the application has access to the specified secret.

        It is assumed, that if the DESC SECRET query describes the specified secret - the application has access to it.

        Parameters:
        secret - secret object name
        Returns:
        whether the application has access to the specified secret
      • getInstance

        static AccessTools getInstance​(Session session)
        Returns a new instance of the default tools implementation.
        Parameters:
        session - Snowpark session object
        Returns:
        a new tools instance