Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计异常

clickhouse-pydantic-configclickhouse pydantic 配置

Agent Skill

clickhouse-pydantic-config 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,016

周安装

84

GitHub Stars

38

下载量

672
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:clickhouse-pydantic-config(clickhouse pydantic 配置)
来源仓库:https://github.com/terrylica/cc-skills
仓库路径:skills/clickhouse-pydantic-config
安装命令:
npx skills add https://github.com/terrylica/cc-skills --skill clickhouse-pydantic-config
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/terrylica/cc-skills --skill clickhouse-pydantic-config

简介

clickhouse-pydantic-config 从 Pydantic v2 模型生成 DBeaver 数据库连接配置。

  • 它以 mise [env] 为唯一事实源,自动映射字段类型与约束条件。
  • 利用 ClickHouse COMMENT 注解传递语义信息,提升配置可读性。
  • 使用前需确保 .env 文件中已设置正确的数据库凭据与安全策略。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

ClickHouse Pydantic Config

Generate DBeaver database client configurations from Pydantic v2 models using mise [env] as Single Source of Truth (SSoT).

Schema documentation principle: ClickHouse table/column COMMENTs are the SSoT for what each column means and how it's computed. See quality-tools:clickhouse-architect for the full COMMENT policy.

Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.

When to Use This Skill

Use this skill when:

  • Setting up DBeaver connections for ClickHouse databases
  • Generating database client configurations from environment variables
  • Managing local vs cloud ClickHouse connection profiles
  • Integrating ClickHouse with mise-based development workflows
  • Automating DBeaver data-sources.json generation

Critical Design Principle: Semi-Prescriptive Adaptation

This skill is NOT a rigid template. It provides a SSoT pattern that MUST be adapted to each repository's structure and local database situation.

Why This Matters

Each repository has unique:

  • Directory layouts (.dbeaver/ location may vary)
  • Environment variable naming conventions
  • Existing connection management patterns
  • Local vs cloud database mix

The SSoT principle is the constant; the implementation details are the variables.

Quick Start

# Generate local connection config
mise run db-client-generate

# Generate cloud connection config
mise run db-client:cloud

# Preview without writing
mise run db-client:dry-run

# Launch DBeaver
mise run dbeaver

Credential Prerequisites (Cloud Mode)

Before using cloud mode, obtain credentials via the skill chain:

  1. Create/retrieve user: Use clickhouse-cloud-management skill to create read-only users or retrieve existing credentials from 1Password
  2. Store in.env: Add to .env file (gitignored):
CLICKHOUSE_USER_READONLY=your_user
CLICKHOUSE_PASSWORD_READONLY=your_password
  1. Generate config: Run mise run db-client:cloud

Skill chain: clickhouse-cloud-management.envclickhouse-pydantic-config

mise [env] as Single Source of Truth

All configurable values live in .mise.toml:

[env]
CLICKHOUSE_NAME = "clickhouse-local"
CLICKHOUSE_MODE = "local"  # "local" or "cloud"
CLICKHOUSE_HOST = "localhost"
CLICKHOUSE_PORT = "8123"
CLICKHOUSE_DATABASE = "default"

Scripts read from os.environ.get() with backward-compatible defaults—works with or without mise installed.

Credential Handling by Mode

ModeApproachRationale
LocalHardcode default user, empty passwordZero friction, no security concern
CloudPre-populate from .envRead from environment, write to gitignored JSON

Key principle: The generated data-sources.json is gitignored anyway. Pre-populating credentials trades zero security risk for maximum developer convenience.

Cloud Credentials Setup

# .env (gitignored)
CLICKHOUSE_USER_READONLY=readonly_user
CLICKHOUSE_PASSWORD_READONLY=your-secret-password

Repository Adaptation Workflow

Pre-Implementation Discovery (Phase 0)

Before writing any code, the executor MUST:

# 1. Discover existing configuration patterns
fd -t f ".mise.toml" .
fd -t f ".env*" .
fd -t d ".dbeaver" .

# 2. Test ClickHouse connectivity (local)
clickhouse-client --host localhost --port 9000 --query "SELECT 1"

# 3. Check for existing connection configs
fd -t f "data-sources.json" .
fd -t f "dataSources.xml" .

Adaptation Decision Matrix

Discovery FindingAdaptation Action
Existing .mise.toml at repo rootExtend existing [env] section, don't create new file
Existing .dbeaver/ directoryMerge connections, preserve existing entries
Non-standard CLICKHOUSE_* varsMap to repository's naming convention
Multiple databases (local + cloud)Generate multiple connection entries
No ClickHouse availableWarn and generate placeholder config

Validation Checklist (Post-Generation)

The executor MUST verify:

  • Generated JSON is valid (jq..dbeaver/data-sources.json)
  • DBeaver can import the config (launch and verify connection appears)
  • mise tasks execute without error (mise run db-client-generate)
  • .dbeaver/ added to .gitignore

Pydantic Model

The ClickHouseConnection model provides:

  • Type-safe configuration with Pydantic v2 validation
  • Computed fields for JDBC URL and connection ID
  • Mode-aware defaults (cloud auto-enables SSL on port 8443)
  • Environment loading via from_env() class method

See references/pydantic-model.md for complete model documentation.

DBeaver Format

DBeaver uses .dbeaver/data-sources.json with this structure:

{
  "folders": {},
  "connections": {
    "clickhouse-jdbc-{random-hex}": {
      "provider": "clickhouse",
      "driver": "com_clickhouse",
      "name": "Connection Name",
      "configuration": { ... }
    }
  }
}

Important: DBeaver does NOT support ${VAR} substitution—values must be pre-populated at generation time.

See references/dbeaver-format.md for complete format specification.

macOS Notes

  1. DBeaver binary: Use /Applications/DBeaver.app/Contents/MacOS/dbeaver (NOT open -a)
  2. Gitignore: Add .dbeaver/ to .gitignore

Related Skills

SkillIntegration
devops-tools:clickhouse-cloud-managementCredential retrieval for cloud mode
quality-tools:clickhouse-architectSchema design context
itp:mise-configurationSSoT environment variable patterns

Python Driver Policy

For Python application code connecting to ClickHouse (not DBeaver), use clickhouse-connect (official HTTP driver). See clickhouse-architect for:

  • Recommended code patterns
  • Why NOT to use clickhouse-driver (community)
  • Performance vs maintenance trade-offs

Additional Resources

ReferenceContent
references/pydantic-model.mdComplete model documentation
references/dbeaver-format.mdDBeaver JSON format spec

Troubleshooting

IssueCauseSolution
DBeaver can't connectPort mismatch (8123 vs 9000)HTTP uses 8123, native uses 9000 - check config
Credentials not loading.env not sourcedRun mise trust or source.env manually
JSON validation failsInvalid data-sources.jsonValidate with jq..dbeaver/data-sources.json
Cloud SSL errorMissing SSL on port 8443Cloud mode auto-enables SSL - verify port is 8443
mise task not foundMissing task definitionAdd task to mise.toml [tasks] section
.dbeaver/ in gitMissing gitignore entryAdd .dbeaver/ to .gitignore
Connection ID conflictDuplicate connection namesEach connection needs unique ID (random hex)
Config not updatingDBeaver cachingRestart DBeaver to reload data-sources.json

Post-Execution Reflection

After this skill completes, check before closing:

  1. Did the command succeed? — If not, fix the instruction or error table that caused the failure.
  2. Did parameters or output change? — If the underlying tool's interface drifted, update Usage examples and Parameters table to match.
  3. Was a workaround needed? — If you had to improvise (different flags, extra steps), update this SKILL.md so the next invocation doesn't need the same workaround.

Only update if the issue is real and reproducible — not speculative.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

25.84%
按下载量换算174

OpenCode

23.63%
按下载量换算159

Antigravity

17.5%
按下载量换算118

Gemini CLI

12.74%
按下载量换算86

windsurf

6.57%
按下载量换算44

trae

3.39%
按下载量换算23

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills