Accessing Map Metadata with SQL Queries
Overview
Honeycomb Maps stores all map data and metadata in Snowflake Hybrid Tables within your Snowflake account. These tables are accessible to admin users and support the application's enterprise-grade permissions system. Because metadata is stored in standard Snowflake tables, you can use SQL queries to access, analyze, and manage map information.
Benefits
Storing metadata in Snowflake Hybrid Tables provides several advantages:
- Direct SQL access: Query map metadata using standard Snowflake SQL
- Data portability: Copy tables for backup or integration purposes
- Automation support: Populate or manage data using tools like dbt
- Increased reliability: Data persists independently of the application
- Integration capabilities: Connect map metadata to existing data workflows and reporting systems
Available Metadata Tables
Admin users can access the following tables:
MAPS Table
Contains metadata for all maps created in Honeycomb Maps.
USERS Table
Tracks all users who have accessed the application.
MAP_PERMISSIONS Table
Stores permission assignments that control map access and editing rights.
MAP_HISTORY Table
Tracks historical changes and modifications to maps.
Querying Metadata
Admin users can query these tables using standard SQL syntax through any Snowflake interface, including Snowsight, SnowSQL, or programmatic connections.
Example Queries
Note: Replace
<HONEYCOMB_MAPS>
with the application name you specified when installing Honeycomb Maps.
View all maps:
SELECT * FROM <HONEYCOMB_MAPS>.CONFIG.MAPS;
SELECT * FROM <HONEYCOMB_MAPS>.CONFIG.MAPS;
View all users:
SELECT * FROM <HONEYCOMB_MAPS>.CONFIG.USERS;
SELECT * FROM <HONEYCOMB_MAPS>.CONFIG.USERS;
View map permissions:
SELECT * FROM <HONEYCOMB_MAPS>.CONFIG.MAP_PERMISSIONS;
SELECT * FROM <HONEYCOMB_MAPS>.CONFIG.MAP_PERMISSIONS;
View map history:
SELECT * FROM <HONEYCOMB_MAPS>.CONFIG.MAP_HISTORY;
SELECT * FROM <HONEYCOMB_MAPS>.CONFIG.MAP_HISTORY;
Use Cases
Backup and Recovery
Create backups of map metadata by copying tables to another database or schema:
CREATE TABLE BACKUP_DATABASE.BACKUP_SCHEMA.MAPS AS
SELECT * FROM <HONEYCOMB_MAPS>.CONFIG.MAPS;
CREATE TABLE BACKUP_DATABASE.BACKUP_SCHEMA.MAPS AS
SELECT * FROM <HONEYCOMB_MAPS>.CONFIG.MAPS;
Reporting and Analytics
Join metadata tables with other Snowflake data sources to create custom reports on the number of maps created, users who have accessed the app, and permission distribution.
Automation with dbt
Integrate Honeycomb Maps metadata into your dbt workflows to store map definitions as code in a version-control system (VCS) like GitHub.
Auditing
Query the metadata tables to audit map ownership and changes, as well as permissions and permission changes.
Permissions
Access to metadata tables is controlled by Honeycomb Maps application roles. Each role has specific permissions on the CONFIG schema tables:
HONEYCOMB_APP_ADMIN Role
Users with the HONEYCOMB_APP_ADMIN
application role have full permissions on all metadata tables:
- USERS: ALL privileges
- MAPS: ALL privileges
- MAP_PERMISSIONS: ALL privileges
- MAP_HISTORY: ALL privileges
HONEYCOMB_APP_EDITOR Role
Users with the HONEYCOMB_APP_EDITOR
application role have the following permissions:
- USERS: SELECT, INSERT, UPDATE
- MAPS: SELECT, INSERT, UPDATE
- MAP_PERMISSIONS: SELECT, INSERT, UPDATE, DELETE
- MAP_HISTORY: SELECT
HONEYCOMB_APP_VIEWER Role
Users with the HONEYCOMB_APP_VIEWER
application role have the following permissions:
- USERS: SELECT, INSERT, UPDATE (required for new user auto-enrollment)
- MAPS: SELECT
- MAP_PERMISSIONS: SELECT
- MAP_HISTORY: SELECT