Integration & API
Programmatic access to attributes via system views and stored procedures for automation and external system integration.
Views
vw_datasource_active_attributes
Purpose: All active polymorphic versions with complete metadata for code generation.
Use cases: UI display, programmatic access, code generation input.
Example:
SELECT *
FROM vw_datasource_active_attributes
WHERE datasource_id = 'your-datasource-id'
AND INCLUDE_IN_CODE_GEN = TRUE
ORDER BY ATTRIBUTE_PATH;vw_datasource_all_attributes
Purpose: All polymorphic versions (active and inactive) for schema analysis and version history.
Use cases: Schema drift analysis, understanding all possible variations.
Example:
SELECT
ATTRIBUTE_PATH,
POLYMORPHIC_ATTRIBUTE_NAME,
VERSION_STATUS,
VERSION_STATUS_DATE
FROM vw_datasource_all_attributes
WHERE datasource_id = 'your-datasource-id'
ORDER BY ATTRIBUTE_PATH, POLYMORPHIC_ATTRIBUTE_NAME;vw_datasource_version_all_attributes
Purpose: Version information for schema evolution tracking.
Use cases: Monitoring schema drift, tracking schema evolution.
Example:
Stored Procedures
sp_upsert_attribute
Purpose: Creates or updates attributes from scan results (internal use during scanning).
Parameters:
DATASOURCE_ID(varchar)DATASOURCE_VERSION_ID(varchar)ATTRIBUTE_DATA(varchar) - JSON string containing attribute data
Note: Typically not called directly by users; used internally during scan process.
sp_upsert_virtual_datasource_attribute
Purpose: Creates or updates virtual attributes.
Parameters:
DATASOURCE_ID(varchar)ATTRIBUTE_NAME(varchar) - No spaces allowedSOURCE_DATA_TYPE(varchar)PLATFORM_DATA_TYPE(varchar) - Snowflake data typeDATASOURCE_ATTRIBUTE_POLYMORPHIC_VERSION_ID_PARENT_ARRAY(varchar) - Optional, for array-level virtual attributesTRANSFORMATION_EXPRESSION(varchar) - Required SQL expressionW_QUESTION_CATEGORY(varchar) - Optional, for Cortex AnalystATTRIBUTE_DESCRIPTION(varchar) - OptionalATTRIBUTE_ID(varchar) - Optional, for updates
Example:
sp_update_attribute_polymorphic_versions
Purpose: Bulk updates to polymorphic version metadata.
Parameters: All JSON strings containing updates:
UPDATED_VERSION_ROWS_SOURCE_SCHEMA- Source schema updatesUPDATED_VERSION_ROWS_DESTINATION_SCHEMA- Destination schema updatesUPDATED_VERSION_ROWS_TRANSFORMATION- Transformation updatesUPDATED_VERSION_ROWS_CONSOLIDATION- Consolidation updatesUPDATED_VERSION_ROWS_GOVERNANCE- Governance updatesUPDATED_VERSION_ROWS_SEMANTIC_MODEL- Semantic model updates
Usage: Bulk updates via JSON input; multiple attributes in single call.
update_attribute_metadata_core
Purpose: Bulk update via CSV integration.
Parameters:
USER_NAME(varchar) - User performing the updateATTRIBUTE_DATA(varchar) - JSON string with attribute dataFILE_PATH(varchar) - Path to CSV file in Snowflake stage (e.g.,@stage/path/to/file.csv)
Process:
Upload CSV to Snowflake stage
Call
core.update_attribute_metadata_corewith file pathProcedure reads CSV and applies updates
Review returned results for success/failure
CSV requirements:
Must include
_IDorPOLYMORPHIC_VERSION_IDcolumn for identificationInclude columns for fields to update
Follow DataPancake column naming conventions
Supported fields: All metadata fields (data types, transformations, security policies, etc.). See DataPancake Metadata Fields.
Integration Patterns
Bulk configuration update:
Export current attribute configuration to CSV
Modify CSV with desired changes
Upload CSV to Snowflake stage
Call
core.update_attribute_metadata_coreVerify updates
Programmatic virtual attribute creation:
Call
core.sp_upsert_virtual_datasource_attributefor each attributeVerify creation
Generate code
Schema drift response:
Monitor
vw_datasource_version_all_attributesfor changesIdentify newly activated versions (
VERSION_STATUS_DATEchanges)Configure new versions programmatically
Regenerate code
Best Practices
Error handling:
Check return values from stored procedures
Validate input data before calling procedures
Performance:
Use bulk operations (
update_attribute_metadata_coreorsp_update_attribute_polymorphic_versions) for multiple attributesAvoid updating attributes one-by-one
Security:
Use appropriate roles and permissions
Audit integration operations
Last updated
Was this helpful?