# Integration & Code Generation Views

## VW\_DATASOURCE\_ACTIVE\_ATTRIBUTES\_SEMANTIC\_LAYER

Active attributes configured for semantic layer views with complete transformation metadata.

**Contents:** Semantic layer configuration, view object names, transformation expressions, security policy settings, foreign key relationships, parent array information

**Use cases:** Semantic layer code generation, view configuration, integration workflows

***

## VW\_DATASOURCE\_ACTIVE\_ATTRIBUTES\_GEN\_AI\_SEMANTIC\_MODEL

Attributes configured for Cortex Analyst semantic model generation.

**Contents:** Gen AI semantic model configuration, W question categories, semantic model expressions, reference column names, parent relationships, synonyms, comments

**Use cases:** Cortex Analyst semantic model generation, Gen AI integration, semantic model configuration

***

## VW\_DATASOURCE\_RELATIONSHIPS\_GEN\_AI\_SEMANTIC\_MODEL

Relationships between tables for Cortex Analyst semantic model.

**Contents:** Relationship names/descriptions, left/right table names, join types, relationship types, foreign key columns, data types

**Use cases:** Cortex Analyst semantic model generation, relationship configuration

***

## VW\_DATASOURCE\_QUERIES\_GEN\_AI\_SEMANTIC\_MODEL

Verified queries for Cortex Analyst semantic model onboarding.

**Contents:** Query names/questions, query SQL, query order, onboarding question flags

**Use cases:** Cortex Analyst onboarding, query management

***

## VW\_DATASOURCE\_FOREIGN\_KEYS

Foreign key relationships for array tables.

**Contents:** Array identification, foreign key attribute names, foreign key alias names, security policy inclusion (`INCLUDE_COLUMN_IN_ROW_ACCESS_POLICY`), row access policy order (`ROW_ACCESS_POLICY_COLUMN_ORDER`)

**Use cases:** Foreign key configuration review, relationship management, integration workflows

Example Query:

{% code title="Example SQL" %}

```sql
SELECT 
    datasource_name,
    polymorphic_attribute_name,
    parent_attribute_name,
    foreign_key_alias_name,
    INCLUDE_COLUMN_IN_ROW_ACCESS_POLICY
FROM core.vw_datasource_foreign_keys
WHERE datasource_id = 'your-datasource-id';
```

{% endcode %}

***

## VW\_DATASOURCE\_RELATIONSHIPS

Array relationship configuration.

**Contents:** Relationship names/descriptions, relationship types (`many_to_one`, `one_to_one`), join types (`left_outer`, `inner`), left/right table names, foreign key columns

**Use cases:** Relationship configuration review, documentation

***

## VW\_DATASOURCE\_ALIASED\_FOREIGN\_KEYS

Foreign keys with custom alias names for semantic layer integration.

**Contents:** Foreign key attribute names, foreign key alias names, data types

**Use cases:** Semantic layer integration, foreign key alias management

**Note:** This view is not explicitly defined in the codebase; may be referenced but not created.

***

## VW\_DATASOURCE\_SQL\_CODE

Generated SQL code blocks for data sources.

**Contents:** Version number, code blocks by object type (`sql_code_object_type`), complete SQL code (`sql_code`), code order (`sql_code_order`), deployment status, deployment datetime

**Use cases:** Code review, code export, version comparison

***

## VW\_DATASOURCE\_SQL\_CODE\_SUMMARY

Summary of generated SQL code.

**Contents:** Code generation summary, object counts by type (`sql_code_object_type`), last version number, last created datetime

**Use cases:** Code generation overview, quick reference

***

## VW\_DATASOURCE\_CODE\_BLOCK

Aggregated code blocks for a data source version.

**Contents:** Version number, complete code block (all objects concatenated), code order

**Use cases:** Complete code export, version comparison

**Note:** This view is not explicitly defined in the codebase; may be referenced but not created.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.datapancake.com/core-concepts/views/integration-and-code-generation-views.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
