一键导入
layer-08-data-store
Expert knowledge for Data Store Layer modeling in Documentation Robotics
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Expert knowledge for Data Store Layer modeling in Documentation Robotics
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Expert knowledge for Data Store Layer modeling in Documentation Robotics
Graph-based code intelligence for using dr analyzer subcommands to understand codebase structure, discover elements, and verify model alignment
Expert knowledge for Application Layer modeling in Documentation Robotics
Expert knowledge for Motivation Layer modeling in Documentation Robotics
Expert knowledge for Business Layer modeling in Documentation Robotics
Expert knowledge for Security Layer modeling in Documentation Robotics
| name | LAYER_08_DATA_STORE |
| description | Expert knowledge for Data Store Layer modeling in Documentation Robotics |
| triggers | ["database","table","column","SQL","DDL","data-store","PostgreSQL","MySQL","index","constraint"] |
| version | 0.7.0 |
Layer Number: 08 Specification: Metadata Model Spec v0.7.0 Purpose: Defines physical database design using SQL DDL, specifying databases, tables, columns, indexes, constraints, and triggers.
The Data Store Layer captures physical database design:
This layer uses SQL DDL concepts with support for PostgreSQL, MySQL, SQLite, and other RDBMS.
Central Entity: The Table (database table) is the core modeling unit.
| Entity Type | Description |
|---|---|
| Database | Database instance with schemas |
| DatabaseSchema | Logical grouping of tables |
| Table | Database table with columns and constraints |
| Column | Table column with data type and constraints |
| Index | Query optimization index |
| Constraint | PRIMARY KEY, UNIQUE, FOREIGN KEY, CHECK, EXCLUSION |
| Trigger | Database trigger with timing and events |
| View | Database view (regular or materialized) |
| Sequence | Auto-increment sequences |
| Partition | Table partitioning configuration |
Activate when the user:
Outgoing (Data Store → Other Layers):
x-json-schema → Data Model Layer (what logical schema does this implement?)x-governed-by-* → Security Layer (data access policies)x-apm-performance-metrics → APM Layer (query performance monitoring)Incoming (Other Layers → Data Store):
# Add database table
dr add data-store table --name "users" --property schema=public
# Add column to table
dr add data-store column --name "email" --property dataType=VARCHAR
# List tables
dr list data-store table
# Validate data-store layer
dr validate --layer data-store
# Export as SQL DDL
dr export --layer data-store --format sql
id: data-store.table.users
name: "Users Table"
type: table
properties:
schema: public
columns:
- id:
dataType: UUID
nullable: false
defaultValue: gen_random_uuid()
- email:
dataType: VARCHAR(255)
nullable: false
x-pii: true
x-encrypted: true
- username:
dataType: VARCHAR(50)
nullable: false
- password_hash:
dataType: VARCHAR(255)
nullable: false
x-encrypted: true
- created_at:
dataType: TIMESTAMP
nullable: false
defaultValue: CURRENT_TIMESTAMP
- last_login:
dataType: TIMESTAMP
nullable: true
constraints:
- type: PRIMARY_KEY
columns: [id]
- type: UNIQUE
columns: [email]
- type: UNIQUE
columns: [username]
indexes:
- name: idx_users_email
columns: [email]
type: BTREE
- name: idx_users_created_at
columns: [created_at]
type: BTREE
x-json-schema: data_model.object-schema.user
x-apm-performance-metrics:
- apm.metric.users-query-latency