create role metabase_user with
  login
  nosuperuser
  nocreatedb
  nocreaterole
  noinherit
  noreplication
  connection limit -1
  password 'supermotdepasse';

create database metabase
  with owner metabase_user;

grant connect on database metabase to metabase_user;


grant usage
  on schema public
  to metabase_user;

grant select on all tables
  in schema public
  to metabase_user;

/* User grafana */

create role grafana_user with
  login
  nosuperuser
  nocreatedb
  nocreaterole
  noinherit
  noreplication
  connection limit -1
  password 'supermotdepasse';

  grant usage
  on schema public
  to grafana_user;

grant select on all tables
  in schema public
  to grafana_user;

create extension anon;
select anon.init();
