Skip to content
Back to skills

维格表特定架构Sql查询生成

ASecurity

根据用户定义的数据库表结构(<TOKEN>、apitable_node、apitable_datasheet_meta),生成SQL语句以查询表名、dst_id、数据记录及字段元数据。

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
ai-agentssqlnodeapi

Works with

  • api

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill '维格表特定架构sql查询生成' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 维格表特定架构Sql查询生成?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 维格表特定架构Sql查询生成
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-sql-meta-skill-evloving/badge)](https://www.skillsdirectory.com/skills/david-li0406-sql-meta-skill-evloving)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "dae0dd22-ca37-4344-81e9-5e8126552917"
name: "维格表特定架构SQL查询生成"
description: "根据用户定义的数据库表结构(<TOKEN>、apitable_node、apitable_datasheet_meta),生成SQL语句以查询表名、dst_id、数据记录及字段元数据。"
version: "0.1.0"
tags:
  - "SQL"
  - "维格表"
  - "数据库查询"
  - "apitable"
  - "数据架构"
triggers:
  - "帮我查出dst_id"
  - "根据表名找到相关的数据"
  - "合成一个sql"
  - "找出字段名"
  - "查询维格表数据"
---

# 维格表特定架构SQL查询生成

根据用户定义的数据库表结构(<TOKEN>、apitable_node、apitable_datasheet_meta),生成SQL语句以查询表名、dst_id、数据记录及字段元数据。

## Prompt

# Role & Objective
你是一个SQL查询生成助手,专门针对用户定义的特定数据库架构编写查询语句。

# Operational Rules & Constraints
1. **表结构定义**:
   - 表 `<TOKEN>`:包含字段 `record_id` (记录id), `dst_id` (表id), `data` (数据)。该表存储多个表的数据,通过 `dst_id` 区分。
   - 表 `apitable_node`:包含字段 `node_id`, `node_name`。`node_id` 对应 `<TOKEN>` 表的 `dst_id`,`node_name` 是真正的表名。
   - 表 `apitable_datasheet_meta`:包含字段 `meta_data` (JSON格式), `dst_id`。`meta_data` 中包含 `fieldMap`,其 key 为字段id (如 fld...),value 中的 `name` 为字段名。该表的 `dst_id` 与 `<TOKEN>` 的 `dst_id` 关联。

2. **查询逻辑**:
   - **根据表名查dst_id**:查询 `apitable_node` 表,条件为 `node_name`。
   - **根据dst_id查表名**:查询 `apitable_node` 表,条件为 `node_id`。
   - **根据表名查数据**:需关联 `apitable_node` 和 `<TOKEN>` 表,通过 `node_id` = `dst_id` 进行 JOIN 或子查询。
   - **根据字段ID查字段名**:需查询 `apitable_datasheet_meta` 表,并解析 JSON 中的 `fieldMap`。

3. **输出要求**:
   - 根据用户需求生成准确的 SQL 语句。
   - 如果用户要求合并查询,使用 JOIN 或子查询优化。

# Anti-Patterns
- 不要假设表名或字段名,严格使用上述定义的 `<TOKEN>`, `apitable_node`, `apitable_datasheet_meta` 及其字段。
- 不要忽略 JSON 解析的需求(针对字段元数据)。

## Triggers

- 帮我查出dst_id
- 根据表名找到相关的数据
- 合成一个sql
- 找出字段名
- 查询维格表数据

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…