# Attribute Metadata

## Overview

Attributes are discovered during scanning and serve as the metadata foundation for generating Dynamic Tables and Views. DataPancake discovers every attribute path at any nesting depth, including:

* All nested structures (any depth)
* Embedded/stringified JSON (recursively parsed)
* Polymorphic variations (same path, different data types)

**Key DataPancake Behavior:** When an attribute is first discovered, DataPancake **proactively creates all 7 polymorphic versions** immediately. Only versions matching discovered data types are activated (`VERSION_STATUS = 'active'`). Inactive versions remain ready for future activation, enabling seamless schema evolution.

***

## Documentation

* [**Attribute Discovery**](https://docs.datapancake.com/core-concepts/attribute-metadata/attribute-discovery-process) - Discovery process and embedded JSON handling
* [**Attribute Types**](https://docs.datapancake.com/core-concepts/attribute-metadata/attribute-metadata-types) - Discovered, Schema, and Virtual attributes
* [**Polymorphic Versions**](https://docs.datapancake.com/core-concepts/attribute-metadata/polymorphic-versions) - The 7 polymorphic variations and proactive creation
* [**Attribute Metadata Fields**](https://docs.datapancake.com/core-concepts/attribute-metadata/datapancake-metadata-fields) - Complete field reference
* [**Arrays & Nested Structures**](https://docs.datapancake.com/core-concepts/attribute-metadata/arrays-and-nested-structures) - Array handling and relationships
* [**Attribute Lifecycle**](https://docs.datapancake.com/core-concepts/attribute-metadata/attribute-lifecycle) - Creation, versioning, and schema evolution
* [**Attributes in Code Generation**](https://docs.datapancake.com/core-concepts/attribute-metadata/attributes-in-code-generation) - How attributes become SQL columns
* [**Integration & API**](https://docs.datapancake.com/core-concepts/attribute-metadata/integration-and-api) - Stored procedures and views

***

## Quick Reference

**Attribute Types:**

* `'Discovered'` - Found during scanning (`ATTRIBUTE_CREATE_TYPE = 'Discover'`)
* `'Schema'` - Created from schema samples (`ATTRIBUTE_CREATE_TYPE = 'Schema'`)
* `'Virtual'` - User-created via UI/API

**The 7 Polymorphic Versions** (created proactively for every attribute):

1. `str` → `{name}_str`
2. `int` → `{name}_int`
3. `float` → `{name}_float`
4. `bool` → `{name}_bool`
5. `object` → `{name}_object`
6. `array_primitive` → `{name}_array_primitive`
7. `array_object` → `{name}_array_object`

**Key Tables:**

* `core.datasource_attribute` - Core attribute metadata
* `core.datasource_attribute_polymorphic_version` - Version-specific metadata
