Code Monkey home page Code Monkey logo

snowflake-inspector's Introduction

CircleCI

Snowflake Inspector

Welcome to the Snowflake Inspector project!

You can access a live version of the tool at http://snowflakeinspector.com

How to Build:

To build the project, ensure you have npm installed and do the following:

  • run npm i to install dependencies
  • run npm run build to build the static website. The files will show up in dist/

Alternatively, you can make use of the Makefile:

  • Run make to install all dependencies and build the production bundle of the inspector site

How to run locally for development

How to build and run with Docker

  • Run npm i to install dependencies
  • Run npx webpack --mode=production to build the production distribution of the static site files
  • Run docker build -t snowflake-inspector . to build the image locally.
  • Run docker run -it -p 8083:80 snowflake-inspector to run a container based on the image you just built.
  • Access the site at http://localhost:8083/bundle.html

Alternatively, you can make use of the Makefile:

  • Run make install && make container to install npm modules, generate the production build of Snowflake Inspector, create a local snowflake-inspector Docker image (based on nginx), and start that container on port 8083
  • Access the site at http://localhost:8083/bundle.html

Providing default hierarchy data on load.

This tool now supports dynamic reading of hierarchy data on load for internal hosting of hierarchy visualizations on load without needing to run SQL manually each time.

To change or updated the default data at runtime, do the following:

  • Find the current default-data.csv at /dist/default-data.csv after building the project. If you are running the project docker container, the csv file is at /usr/share/nginx/html/default-data.csv.
  • Replace the contents of this file with the desired default hierarchy data.
  • Reload the Inspector tool. No rebuilding of the project is required - this is a hot update capability!

Future releases may include a config file for Snowflake access details that will allow the Inspector to update the hierarchy on a schedule, but for now the recommended approach is to scp your updated file into your running server environment to update the default-data.csv.

Reach out + Feedback

You can contact us at https://www.hashmapinc.com/reach-out if you want to learn more about Hashmap.

You can also provide feedback on this tool at https://forms.gle/42ACP1waPistVdTu9

snowflake-inspector's People

Contributors

randypitcherii avatar ganeshx avatar dependabot[bot] avatar skohlleffel avatar

Stargazers

Mario3113 avatar Steven Lloyd avatar Boon Keong avatar Ross Housewright avatar  avatar  avatar Ranjith avatar Markus Thurner avatar App Service avatar Oliver Mannion avatar Jessie Daubner avatar İlkin Balkanay avatar Rob Finneran avatar Callum avatar Sean Cronin avatar  avatar

Watchers

 avatar James Cloos avatar Johan van der Kooij avatar

snowflake-inspector's Issues

As a user, I would like parent nodes and edges to be a different color than child nodes and edges

In the event that there is overlap from parents and children (a cycle exists in the hierarchy), then let the child relationship take precedence

A way to do this would be to first color all parents then color all children. The children coloring will overwrite the parent relationships as they go last.

This is because it is more important to call out what nodes a specific node can access rather than what other nodes can access the clicked node.

Fix flash of unstyled content

Currently, when the page is reloaded, the user sees unstyled HTML content for a brief time. Ideally, this would not happen.

As a user, I can see my Snowflake objects (Datbases, Schemas, objects, and Warehouses) in Snowflake Inspector.

Make sure to edit the hierarchy SQL script to the following:

  USE ROLE ACCOUNTADMIN;

  WITH 
  ROLE_GRANTS AS (
    SELECT
      PRIVILEGE,
      GRANTED_ON    AS GRANTED_ON_TYPE,
      TABLE_CATALOG AS GRANTED_ON_DATABASE,
      TABLE_SCHEMA  AS GRANTED_ON_SCHEMA,
      NAME          AS GRANTED_ON_NAME,
      GRANTED_TO    AS GRANTED_TO_TYPE,
      GRANTEE_NAME  AS GRANTED_TO_NAME
    FROM
      SNOWFLAKE.ACCOUNT_USAGE.GRANTS_TO_ROLES
    WHERE
      DELETED_ON IS NULL
  ),

  USER_GRANTS AS (
    SELECT
    'USAGE'      AS PRIVILEGE,
    'ROLE'       AS GRANTED_ON_TYPE,
    NULL         AS GRANTED_ON_DATABASE,
    NULL         AS GRANTED_ON_SCHEMA,
    ROLE         AS GRANTED_ON_NAME,
    GRANTED_TO   AS GRANTED_TO_TYPE,
    GRANTEE_NAME AS GRANTED_TO_NAME
    FROM
      SNOWFLAKE.ACCOUNT_USAGE.GRANTS_TO_USERS
    WHERE
      DELETED_ON IS NULL
  ),

  GRANTS AS (
    SELECT * FROM ROLE_GRANTS 
    UNION ALL 
    SELECT * FROM USER_GRANTS
  ),

  GRANTS_JSON AS (
    SELECT
      OBJECT_CONSTRUCT(*) AS GRANT_OBJ
    FROM
      GRANTS
  ),

  GRANTS_JSON_ARR AS (
    SELECT
      ARRAY_AGG(*) AS GRANTS
    FROM
      GRANTS_JSON
  )

  SELECT * FROM GRANTS_JSON_ARR;

Add a favicon

It can be the simple hashmap logo or one of our gradient versions, doesn't matter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.