{"id":"4f0fe93d-7889-41c0-8af8-a7b9c732c06a","entityType":"agent","slug":"clawhub-jami-lin-dbskill","name":"database_skill","canonicalUrl":"https://www.xpersona.co/agent/clawhub-jami-lin-dbskill","canonicalPath":"/agent/clawhub-jami-lin-dbskill","generatedAt":"2026-10-11T03:53:31.224Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T01:04:05.405Z","emptyReason":null},"description":"Python-based database connectivity skill supporting MySQL, PostgreSQL, Oracle, SQL Server, and SQLite. Provides connection management, parameterized query ex... Skill: database_skill Owner: jami-lin Summary: Python-based database connectivity skill supporting MySQL, PostgreSQL, Oracle, SQL Server, and SQLite. Provides connection management, parameterized query ex... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-05-01T16:19:11.957Z | user Initial release of database-skill — a Python-based database connectivity tool. - Supports MySQL, PostgreSQL, Oracle, SQL Server, and SQ","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.2K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s179a0cbz8d1bjgrnrqga46wyx85xd9y:dbskill","sourceUrl":"https://clawhub.ai/jami-lin/dbskill","homepage":"https://clawhub.ai/jami-lin/skills/dbskill","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/jami-lin/dbskill","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/jami-lin/skills/dbskill","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":62,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Python-based database connectivity skill supporting MySQL, PostgreSQL, Oracle, SQL Server, and SQLite. Provides connection management, parameterized query ex..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T01:04:05.405Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T01:04:05.405Z","emptyReason":null},"stars":null,"forks":null,"downloads":1211,"packageName":null,"latestVersion":"1.0.0","tractionLabel":"1.2K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T01:04:05.336Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T01:04:05.405Z","lastCrawledAt":"2026-10-11T01:04:05.336Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T01:04:05.336Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.0","createdAt":"2026-05-01T16:19:11.957Z","changelog":"Initial release of database-skill — a Python-based database connectivity tool. - Supports MySQL, PostgreSQL, Oracle, SQL Server, and SQLite via Python 3.8+ - Provides connection management, parameterized query execution, schema introspection, and transaction management - Offers CLI, YAML config, and built-in default configuration options - Features secure handling: no password persistence, recommends environment variables, supports saved connections - Includes comprehensive API with `ConnectionManager`, `QueryExecutor`, `SchemaInspector`, and case-insensitive results - Documentation available in English and 中文 for easy adoption","fileCount":14,"zipByteSize":22490}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s179a0cbz8d1bjgrnrqga46wyx85xd9y:dbskill","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jami-lin-dbskill/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jami-lin-dbskill/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jami-lin-dbskill/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jami-lin-dbskill/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jami-lin-dbskill/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jami-lin-dbskill/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T03:53:31.224Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jami-lin-dbskill/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jami-lin-dbskill/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jami-lin-dbskill/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jami-lin-dbskill/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T01:04:05.405Z","emptyReason":null},"readme":"Skill: database_skill\n\nOwner: jami-lin\n\nSummary: Python-based database connectivity skill supporting MySQL, PostgreSQL, Oracle, SQL Server, and SQLite. Provides connection management, parameterized query ex...\n\nTags: latest:1.0.0\n\nVersion history:\n\nv1.0.0 | 2026-05-01T16:19:11.957Z | user\n\nInitial release of database-skill — a Python-based database connectivity tool.\n\n- Supports MySQL, PostgreSQL, Oracle, SQL Server, and SQLite via Python 3.8+\n- Provides connection management, parameterized query execution, schema introspection, and transaction management\n- Offers CLI, YAML config, and built-in default configuration options\n- Features secure handling: no password persistence, recommends environment variables, supports saved connections\n- Includes comprehensive API with `ConnectionManager`, `QueryExecutor`, `SchemaInspector`, and case-insensitive results\n- Documentation available in English and 中文 for easy adoption\n\nArchive index:\n\nArchive v1.0.0: 14 files, 22490 bytes\n\nFiles: config/datasource-test.yml (270b), config/datasource.yml (356b), references/connection-pooling.md (1502b), references/query-execution.md (1500b), references/supported-databases.md (2359b), scripts/connection_manager.py (8312b), scripts/connections_store.py (6004b), scripts/exceptions.py (511b), scripts/main.py (10918b), scripts/query_executor.py (7728b), scripts/schema_inspector.py (18424b), skill-card.md (2607b), SKILL.md (7210b), _meta.json (126b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: database-skill\nversion: 1.0.0\ntype: skill\ndescription: \"Python-based database connectivity skill supporting MySQL, PostgreSQL, Oracle, SQL Server, and SQLite. Provides connection management, parameterized query execution, schema introspection, and transaction management. Requires Python 3.8+.\"\n---\n\n# database-skill — Python Database Connectivity Skill\n\nEnglish | [中文](#database-skill-中文文档)\n\nThis skill guides an AI Agent to connect to relational databases, execute queries,\nmanage transactions, and introspect schema using Python.\n\n---\n\n<a id=\"database-skill-中文文档\"></a>\n\n# database-skill — Python 数据库连接技能\n\n本技能指导 AI Agent 使用 Python 连接关系型数据库、执行 SQL 查询、管理事务以及探查 Schema 元数据。\n\n---\n\n## When to call / When not to call · 何时调用\n\n| Scenario | Call |\n|---|---|\n| User needs to run SQL queries | Yes |\n| User needs schema introspection (tables, columns, indexes, FK) | Yes |\n| User needs transaction control (commit / rollback) | Yes |\n| Python 3.8+ not available or drivers not installed | No |\n| User only needs text/regex analysis | No |\n\n| 场景 | 调用 |\n|---|---|\n| 用户需要执行 SQL 查询 | 是 |\n| 用户需要 Schema 探查（表、列、索引、外键） | 是 |\n| 用户需要事务控制（提交/回滚） | 是 |\n| 无 Python 3.8+ 或驱动未安装 | 否 |\n| 用户仅需文本/正则分析 | 否 |\n\n---\n\n## Prerequisites · 前提条件\n\n| Requirement | Check |\n|---|---|\n| Python 3.8+ | `python --version` |\n| Target database reachable | `telnet <host> <port>` |\n| Dependencies | `pip install pymysql psycopg2-binary oracledb pymssql pyyaml` |\n\n---\n\n## Quick start · 快速开始\n\n```bash\n# List all tables\npython scripts/main.py \\\n  --url \"jdbc:mysql://localhost:3306/mydb\" \\\n  --user \"root\" \\\n  --password \"${DB_PASS}\" \\\n  --tables\n\n# Parameterized query\npython scripts/main.py \\\n  --url \"jdbc:mysql://localhost:3306/mydb\" \\\n  --user \"root\" \\\n  --password \"${DB_PASS}\" \\\n  --query \"SELECT * FROM user WHERE name = ?\" \"zhangsan\"\n```\n\n---\n\n## Configuration (3 options) · 配置方式（三种）\n\n### A — CLI arguments (recommended) · 命令行参数（推荐）\n\n```bash\npython scripts/main.py \\\n  --url \"jdbc:mysql://host:3306/db\" \\\n  --user \"admin\" \\\n  --password \"${DB_PASS}\" \\\n  --query \"SELECT 1\"\n```\n\n### B — YAML config file · 配置文件\n\n```yaml\n# datasource.yml\ndatasource:\n  url: \"jdbc:mysql://localhost:3306/mydb\"\n  username: \"${DB_USER}\"\n  password: \"${DB_PASS}\"\n```\n\n```bash\npython scripts/main.py --config datasource.yml --tables\n```\n\n### C — Built-in defaults · 内置默认\n\n```bash\npython scripts/main.py --tables\n```\n\n---\n\n## Operations · 操作说明\n\n| Flag | Description | 说明 |\n|---|---|---|\n| `--query <sql> [params...]` | SELECT with `?` placeholders | SELECT 查询，支持参数化 |\n| `--update <sql> [params...]` | UPDATE/INSERT/DELETE | 更新/插入/删除 |\n| `--batch <file>` | Execute SQL file | 批量执行文件中的 SQL |\n| `--tables` | List all tables | 列出所有表 |\n| `--columns <table>` | Show column metadata | 查看表结构 |\n| `--list-connections` | Show saved connections | 查看已保存的连接 |\n| `--forget <url>` | Remove a saved connection | 删除已保存的连接 |\n\nExamples · 示例：\n\n```bash\npython scripts/main.py --url \"jdbc:mysql://host:3306/db\" --user root --password x --tables\npython scripts/main.py --url \"...\" --user root --password x --query \"SELECT * FROM t WHERE id = ?\" 42\npython scripts/main.py --url \"...\" --user root --password x --update \"UPDATE t SET x = ? WHERE id = ?\" \"new\" 1\npython scripts/main.py --list-connections\n```\n\n---\n\n## Scripts · 脚本结构\n\n```\nscripts/\n├── main.py                  # CLI entry point · 命令行入口\n├── connection_manager.py    # Connect / disconnect · 连接管理\n├── connections_store.py     # Persist connections · 连接记录持久化\n├── query_executor.py        # Query, update, batch, transaction · 查询执行\n├── schema_inspector.py      # Schema introspection · Schema 探查\n└── exceptions.py            # Exception hierarchy · 异常层次\n```\n\n---\n\n## API overview · API 概览\n\n### ConnectionManager · 连接管理器\n\n```python\nfrom connection_manager import ConnectionManager\n\ncm = ConnectionManager(url=\"jdbc:mysql://localhost:3306/db\",\n                       username=\"root\", password=\"secret\",\n                       driver=\"pymysql\")\nconn = cm.get_connection()                       # auto-commit\ntx_conn = cm.get_connection_for_transaction()   # manual-commit\ncm.close_connection(conn)\n```\n\n### QueryExecutor · 查询执行器\n\n```python\nfrom query_executor import QueryExecutor\n\nqe = QueryExecutor(cm)\nrows = qe.execute_query(\"SELECT * FROM users WHERE status = ?\", \"ACTIVE\")\naffected = qe.execute_update(\"UPDATE users SET status = ? WHERE id = ?\", \"INACTIVE\", 1)\nqe.execute_batch([\"INSERT INTO log VALUES (1)\", \"INSERT INTO log VALUES (2)\"])\nqe.execute_transaction(lambda tx: (\n    tx.execute_update(\"UPDATE accounts SET balance = balance - 100 WHERE id = ?\", 1),\n    tx.execute_update(\"UPDATE accounts SET balance = balance + 100 WHERE id = ?\", 2),\n))\n```\n\n### CaseInsensitiveDict · 大小写不敏感字典\n\nQuery results are wrapped in ``CaseInsensitiveDict`` so column names are case-insensitive:\n查询结果的列名大小写不敏感：\n\n```python\nrow[\"name\"] == row[\"NAME\"] == row[\"Name\"]\n```\n\n### SchemaInspector · Schema 检查器\n\n```python\nfrom schema_inspector import SchemaInspector\n\nsi = SchemaInspector(cm)\nsi.get_tables()         # 获取所有表\nsi.get_columns(\"users\") # 获取表结构\nsi.get_indexes(\"users\") # 获取索引\nsi.get_foreign_keys(\"users\")  # 获取外键\n```\n\n---\n\n## Saved connections · 连接记录\n\nAfter a successful connection, the skill saves the URL, username, and driver to\n``%TEMP%/.database-skill-connections.json`` (``/tmp/`` on Linux/macOS).\n**Passwords are never stored.**\n\n连接成功后，技能会将 URL、用户名和驱动类型保存到用户临时目录。\n**密码不会被保存。**\n\nWhen no ``--url`` or ``--config`` is provided, the skill shows a numbered list:\n不提供 ``--url`` 或 ``--config`` 时，显示已保存的连接供选择：\n\n```\nSaved connections:\n  [0] MySQL@host1\n  [1] Oracle@orahost\n  [N] Enter a new connection\n```\n\n```bash\npython scripts/main.py --list-connections    # 查看所有连接\npython scripts/main.py --forget \"jdbc:mysql://...\"  # 删除连接\n```\n\n---\n\n## Security rules · 安全守则\n\n1. **Never hard-code passwords** — use environment variables `${DB_PASS}` or CLI.\n   **禁止硬编码密码** — 使用环境变量或命令行参数。\n2. **Always use parameterized queries** — values go as `?` placeholders.\n   **始终使用参数化查询** — 值通过 `?` 占位符传递。\n3. **Transactions auto-commit/rollback** — handled transparently.\n   **事务自动提交/回滚** — 无需手动处理。\n4. **Passwords never persisted** — saved connections store only URL and username.\n   **密码不持久化** — 只保存 URL 和用户名。\n\n---\n\n## Building & testing · 构建与测试\n\n```bash\npip install -e \".[dev]\"\npytest\n```\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn74re96vj4w3vcynfh0sw8hv585wtb6\",\n  \"slug\": \"dbskill\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1777652351957\n}\n\nFile v1.0.0:references/connection-pooling.md\n\n# Connection management · 连接管理\n\nEnglish | [中文](#连接管理)\n\nThe connector uses **direct driver connections** (no connection pool).\n`ConnectionManager` handles connect / disconnect lifecycle.\n\n<a id=\"连接管理\"></a>\n\n连接器使用**直连模式**（无连接池），由 `ConnectionManager` 统一管理连接生命周期。\n\n---\n\n## Driver mapping · 驱动映射\n\n| Database | Python driver | Install |\n|---|---|---|\n| MySQL | `pymysql` | `pip install pymysql` |\n| PostgreSQL | `psycopg2` | `pip install psycopg2-binary` |\n| Oracle | `oracledb` | `pip install oracledb` |\n| SQL Server | `pymssql` | `pip install pymssql` |\n| SQLite / H2 | `sqlite3` | Built-in |\n\n## Connection modes · 连接模式\n\n| Scenario | Method | autocommit |\n|---|---|---|\n| Normal queries | `get_connection()` | `True` |\n| Transactions | `get_connection_for_transaction()` | `False` |\n\n## Transaction isolation · 事务隔离\n\n`execute_transaction` uses `_TxConnectionManager` to route all connections\nto the same underlying connection:\n\n```python\nclass _TxConnectionManager(ConnectionManager):\n    def get_connection(self): return tx_conn\n    def get_connection_for_transaction(self): return tx_conn\n    def close_connection(self, conn): pass\n```\n\n## Safe close · 安全关闭\n\n```python\n@staticmethod\ndef close_connection(conn):\n    if conn is None:\n        return\n    try:\n        conn.close()\n    except Exception:\n        logger.debug(\"Ignored error while closing connection\", exc_info=True)\n```\n\nFile v1.0.0:references/query-execution.md\n\n# Query execution · 查询执行\n\nEnglish | [中文](#查询执行)\n\n`QueryExecutor` provides four execution modes, all supporting **parameterized\nbindings** to prevent SQL injection.\n\n<a id=\"查询执行\"></a>\n\n`QueryExecutor` 提供四种执行模式，全部支持**参数化绑定**以防止 SQL 注入。\n\n---\n\n## Placeholder conversion · 占位符转换\n\nAccepts JDBC-style `?` placeholders, auto-converted to Python `%s`:\n\n支持 JDBC 风格的 `?` 占位符，自动转为 Python 的 `%s`：\n\n```python\n_PLACEHOLDER_RE = re.compile(r\"(?<!\\?)\\?(?!\\?)\")\ndef convert_placeholders(sql: str) -> str:\n    return _PLACEHOLDER_RE.sub(\"%s\", sql)\n```\n\n## Result wrapping · 结果包装\n\nAll query results are wrapped in `CaseInsensitiveDict`:\n\n```python\nd = CaseInsensitiveDict({\"Name\": \"Alice\"})\nd[\"name\"]   # \"Alice\"\nd[\"NAME\"]   # \"Alice\"\nd[\"Name\"]   # \"Alice\"\n```\n\n## Four execution modes · 四种执行模式\n\n```python\n# SELECT\nresults = executor.execute_query(\"SELECT * FROM users WHERE status = ?\", \"ACTIVE\")\n\n# UPDATE / INSERT / DELETE\naffected = executor.execute_update(\"UPDATE users SET status = ? WHERE id = ?\", \"INACTIVE\", 1)\n\n# Batch · 批量\nresults = executor.execute_batch([\"INSERT INTO log VALUES (1)\", \"INSERT INTO log VALUES (2)\"])\n\n# Transaction · 事务\nexecutor.execute_transaction(lambda tx: (\n    tx.execute_update(\"UPDATE accounts SET balance = balance - 100 WHERE id = ?\", 1),\n    tx.execute_update(\"UPDATE accounts SET balance = balance + 100 WHERE id = ?\", 2),\n))\n```\n\nFile v1.0.0:references/supported-databases.md\n\n# Supported databases · 支持的数据库\n\nEnglish | [中文](#支持的数据库)\n\n<a id=\"支持的数据库\"></a>\n\n---\n\n## MySQL 8+\n\n| Property | Value |\n|---|---|\n| Driver | `pymysql` |\n| JDBC URL | `jdbc:mysql://<host>:3306/<db>?useSSL=false&charset=utf8mb4` |\n| Placeholder | `?` (auto-converted to `%s`) |\n| Python lib | `pymysql>=1.1.0` |\n| Schema | `SHOW FULL TABLES`, `SHOW FULL COLUMNS`, `SHOW INDEX` |\n\n## PostgreSQL\n\n| Property | Value |\n|---|---|\n| Driver | `psycopg2` |\n| JDBC URL | `jdbc:postgresql://<host>:5432/<db>` |\n| Placeholder | `?` (auto-converted to `%s`) |\n| Python lib | `psycopg2-binary>=2.9.9` |\n| Schema | `information_schema.tables`, `pg_class` |\n\n## Oracle\n\n| Property | Value |\n|---|---|\n| Driver | `oracledb` |\n| JDBC URL | `jdbc:oracle:thin:@<host>:1521/<service>` |\n| Placeholder | `?` (auto-converted to `%s`) |\n| Python lib | `oracledb>=2.0.0` |\n| Schema | `user_tables`, `user_tab_columns` |\n\n## SQL Server\n\n| Property | Value |\n|---|---|\n| Driver | `pymssql` |\n| JDBC URL | `jdbc:sqlserver://<host>:1433;databaseName=<db>` |\n| Placeholder | `?` (auto-converted to `%s`) |\n| Python lib | `pymssql>=2.2.0` |\n| Schema | `information_schema.tables`, `sys.indexes` |\n\n## SQLite\n\n| Property | Value |\n|---|---|\n| Driver | `sqlite3` (built-in) |\n| JDBC URL | `jdbc:sqlite:<path>/file.db` or `jdbc:h2:mem:test` |\n| Placeholder | `?` (auto-converted to `%s`) |\n| Python lib | None (stdlib) |\n| Schema | `sqlite_master`, `PRAGMA table_info` |\n\n## Column name case sensitivity · 列名大小写\n\n| Driver | Native casing | Wrapper |\n|---|---|---|\n| pymysql | lowercase | CaseInsensitiveDict |\n| psycopg2 | lowercase | CaseInsensitiveDict |\n| oracledb | uppercase | CaseInsensitiveDict |\n| pymssql | lowercase | CaseInsensitiveDict |\n| sqlite3 | as-defined | CaseInsensitiveDict |\n\n## Adding a new database · 扩展新数据库\n\n1. Add JDBC URL prefix to `_DRIVER_REGISTRY` in `connection_manager.py`.\n2. Add lazy import function.\n3. Add `_connect()` branch in `ConnectionManager`.\n4. Add schema queries in `SchemaInspector`.\n5. Add dependency to `pyproject.toml`.\n\n1. 在 `connection_manager.py` 的 `_DRIVER_REGISTRY` 中注册 URL 前缀。\n2. 添加惰性导入函数。\n3. 在 `ConnectionManager._connect()` 中添加分支。\n4. 在 `SchemaInspector` 中适配 Schema 查询。\n5. 在 `pyproject.toml` 中添加依赖。\n\nFile v1.0.0:skill-card.md\n\n## Description:\n\nPython-based database connectivity skill supporting MySQL, PostgreSQL, Oracle, SQL Server, and SQLite with connection management, parameterized query execution, schema introspection, and transaction management.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[jami-lin](https://clawhub.ai/user/jami-lin)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and engineers use this skill to guide agents through connecting to relational databases, running SQL queries, applying updates, managing transactions, and inspecting schema metadata. It is useful when an agent needs database access workflows rather than text-only analysis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Database accounts used through the skill can read or mutate data, including production data.\n\nMitigation: Use least-privilege database accounts and avoid production mutation unless it is explicitly intended and reviewed.\n\nRisk: Untrusted SQL files executed with batch mode can run database-changing statements without parameter binding.\n\nMitigation: Use --batch only with trusted SQL and prefer parameterized query or update execution for user-provided values.\n\nRisk: Credentials or secrets can be exposed through command-line arguments, database URLs, shell expansion, or shared-machine connection metadata.\n\nMitigation: Use environment variables, avoid literal passwords and embedded URL credentials, and move the connection store to a private protected location on shared machines.\n\nRisk: Connections may lack enforced transport protection.\n\nMitigation: Require TLS for database connections before using the skill with sensitive or network-accessible databases.\n\n## Reference(s):\n\n- [Connection management](references/connection-pooling.md)\n- [Query execution](references/query-execution.md)\n- [Supported databases](references/supported-databases.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown with inline bash, YAML, and Python code blocks]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May produce database query results, schema summaries, connection guidance, and command-line usage examples.]\n\n## Skill Version(s):\n\n1.0.0 (source: frontmatter and server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.0:config/datasource-test.yml\n\ndatasource:\n  url: \"jdbc:mysql://localhost:3306/orange?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC\"\n  driver: \"com.mysql.cj.jdbc.Driver\"\n  username: \"${DB_USER}\"\n  password: \"${DB_PASS}\"\n  pool:\n    maxSize: 5\n    minIdle: 1\n    connectionTimeout: 5000\n\nFile v1.0.0:config/datasource.yml\n\ndatasource:\n  url: \"jdbc:mysql://localhost:3306/your_database?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC\"\n  driver: \"com.mysql.cj.jdbc.Driver\"\n  username: \"${DB_USER}\"\n  password: \"${DB_PASS}\"\n  pool:\n    maxSize: 10\n    minIdle: 2\n    connectionTimeout: 30000\n    idleTimeout: 600000\n    maxLifetime: 1800000\n    validationTimeout: 5000","readmeExcerpt":"Skill: database_skill Owner: jami-lin Summary: Python-based database connectivity skill supporting MySQL, PostgreSQL, Oracle, SQL Server, and SQLite. Provides connection management, parameterized query ex... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-05-01T16:19:11.957Z | user Initial release of database-skill — a Python-based database connectivity tool. - Supports MySQL, PostgreSQL, Oracle, SQL Server, and SQ","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"# List all tables\npython scripts/main.py \\\n  --url \"jdbc:mysql://localhost:3306/mydb\" \\\n  --user \"root\" \\\n  --password \"${DB_PASS}\" \\\n  --tables\n\n# Parameterized query\npython scripts/main.py \\\n  --url \"jdbc:mysql://localhost:3306/mydb\" \\\n  --user \"root\" \\\n  --password \"${DB_PASS}\" \\\n  --query \"SELECT * FROM user WHERE name = ?\" \"zhangsan\""},{"language":"bash","snippet":"python scripts/main.py \\\n  --url \"jdbc:mysql://host:3306/db\" \\\n  --user \"admin\" \\\n  --password \"${DB_PASS}\" \\\n  --query \"SELECT 1\""},{"language":"yaml","snippet":"# datasource.yml\ndatasource:\n  url: \"jdbc:mysql://localhost:3306/mydb\"\n  username: \"${DB_USER}\"\n  password: \"${DB_PASS}\""},{"language":"bash","snippet":"python scripts/main.py --config datasource.yml --tables"},{"language":"bash","snippet":"python scripts/main.py --tables"},{"language":"bash","snippet":"python scripts/main.py --url \"jdbc:mysql://host:3306/db\" --user root --password x --tables\npython scripts/main.py --url \"...\" --user root --password x --query \"SELECT * FROM t WHERE id = ?\" 42\npython scripts/main.py --url \"...\" --user root --password x --update \"UPDATE t SET x = ? WHERE id = ?\" \"new\" 1\npython scripts/main.py --list-connections"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: database-skill\nversion: 1.0.0\ntype: skill\ndescription: \"Python-based database connectivity skill supporting MySQL, PostgreSQL, Oracle, SQL Server, and SQLite. Provides connection management, parameterized query execution, schema introspection, and transaction management. Requires Python 3.8+.\"\n---\n\n# database-skill — Python Database Connectivity Skill\n\nEnglish | [中文](#database-skill-中文文档)\n\nThis skill guides an AI Agent to connect to relational databases, execute queries,\nmanage transactions, and introspect schema using Python.\n\n---\n\n<a id=\"database-skill-中文文档\"></a>\n\n# database-skill — Python 数据库连接技能\n\n本技能指导 AI Agent 使用 Python 连接关系型数据库、执行 SQL 查询、管理事务以及探查 Schema 元数据。\n\n---\n\n## When to call / When not to call · 何时调用\n\n| Scenario | Call |\n|---|---|\n| User needs to run SQL queries | Yes |\n| User needs schema introspection (tables, columns, indexes, FK) | Yes |\n| User needs transaction control (commit / rollback) | Yes |\n| Python 3.8+ not available or drivers not installed | No |\n| User only needs text/regex analysis | No |\n\n| 场景 | 调用 |\n|---|---|\n| 用户需要执行 SQL 查询 | 是 |\n| 用户需要 Schema 探查（表、列、索引、外键） | 是 |\n| 用户需要事务控制（提交/回滚） | 是 |\n| 无 Python 3.8+ 或驱动未安装 | 否 |\n| 用户仅需文本/正则分析 | 否 |\n\n---\n\n## Prerequisites · 前提条件\n\n| Requirement | Check |\n|---|---|\n| Python 3.8+ | `python --version` |\n| Target database reachable | `telnet <host> <port>` |\n| Dependencies | `pip install pymysql psycopg2-binary oracledb pymssql pyyaml` |\n\n---\n\n## Quick start · 快速开始\n\n```bash\n# List all tables\npython scripts/main.py \\\n  --url \"jdbc:mysql://localhost:3306/mydb\" \\\n  --user \"root\" \\\n  --password \"${DB_PASS}\" \\\n  --tables\n\n# Parameterized query\npython scripts/main.py \\\n  --url \"jdbc:mysql://localhost:3306/mydb\" \\\n  --user \"root\" \\\n  --password \"${DB_PASS}\" \\\n  --query \"SELECT * FROM user WHERE name = ?\" \"zhangsan\"\n```\n\n---\n\n## Configuration (3 options) · 配置方式（三种）\n\n### A — CLI arguments (recommended) · 命令行参数（推荐）\n\n```bash\npython scripts/main.py \\\n  --url \"jdbc:mysql://host:3306/db\" \\\n  --user \"admin\" \\\n  --password \"${DB_PASS}\" \\\n  --query \"SELECT 1\"\n```\n\n### B — YAML config file · 配置文件\n\n```yaml\n# datasource.yml\ndatasource:\n  url: \"jdbc:mysql://localhost:3306/mydb\"\n  username: \"${DB_USER}\"\n  password: \"${DB_PASS}\"\n```\n\n```bash\npython scripts/main.py --config datasource.yml --tables\n```\n\n### C — Built-in defaults · 内置默认\n\n```bash\npython scripts/main.py --tables\n```\n\n---\n\n## Operations · 操作说明\n\n| Flag | Description | 说明 |\n|---|---|---|\n| `--query <sql> [params...]` | SELECT with `?` placeholders | SELECT 查询，支持参数化 |\n| `--update <sql> [params...]` | UPDATE/INSERT/DELETE | 更新/插入/删除 |\n| `--batch <file>` | Execute SQL file | 批量执行文件中的 SQL |\n| `--tables` | List all tables | 列出所有表 |\n| `--columns <table>` | Show column metadata | 查看表结构 |\n| `--list-connections` | Show saved connections | 查看已保存的连接 |\n| `--forget <url>` | Remove a saved connection | 删除已保存的连接 |\n\nExamples · 示例：\n\n```bash\npython scripts/main.py --url \"jdbc:mysql://host:3306/db\" --user root --password x --tables\npython scripts/main.py --ur"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn74re96vj4w3vcynfh0sw8hv585wtb6\",\n  \"slug\": \"dbskill\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1777652351957\n}"},{"path":"references/connection-pooling.md","content":"# Connection management · 连接管理\n\nEnglish | [中文](#连接管理)\n\nThe connector uses **direct driver connections** (no connection pool).\n`ConnectionManager` handles connect / disconnect lifecycle.\n\n<a id=\"连接管理\"></a>\n\n连接器使用**直连模式**（无连接池），由 `ConnectionManager` 统一管理连接生命周期。\n\n---\n\n## Driver mapping · 驱动映射\n\n| Database | Python driver | Install |\n|---|---|---|\n| MySQL | `pymysql` | `pip install pymysql` |\n| PostgreSQL | `psycopg2` | `pip install psycopg2-binary` |\n| Oracle | `oracledb` | `pip install oracledb` |\n| SQL Server | `pymssql` | `pip install pymssql` |\n| SQLite / H2 | `sqlite3` | Built-in |\n\n## Connection modes · 连接模式\n\n| Scenario | Method | autocommit |\n|---|---|---|\n| Normal queries | `get_connection()` | `True` |\n| Transactions | `get_connection_for_transaction()` | `False` |\n\n## Transaction isolation · 事务隔离\n\n`execute_transaction` uses `_TxConnectionManager` to route all connections\nto the same underlying connection:\n\n```python\nclass _TxConnectionManager(ConnectionManager):\n    def get_connection(self): return tx_conn\n    def get_connection_for_transaction(self): return tx_conn\n    def close_connection(self, conn): pass\n```\n\n## Safe close · 安全关闭\n\n```python\n@staticmethod\ndef close_connection(conn):\n    if conn is None:\n        return\n    try:\n        conn.close()\n    except Exception:\n        logger.debug(\"Ignored error while closing connection\", exc_info=True)\n```"},{"path":"references/query-execution.md","content":"# Query execution · 查询执行\n\nEnglish | [中文](#查询执行)\n\n`QueryExecutor` provides four execution modes, all supporting **parameterized\nbindings** to prevent SQL injection.\n\n<a id=\"查询执行\"></a>\n\n`QueryExecutor` 提供四种执行模式，全部支持**参数化绑定**以防止 SQL 注入。\n\n---\n\n## Placeholder conversion · 占位符转换\n\nAccepts JDBC-style `?` placeholders, auto-converted to Python `%s`:\n\n支持 JDBC 风格的 `?` 占位符，自动转为 Python 的 `%s`：\n\n```python\n_PLACEHOLDER_RE = re.compile(r\"(?<!\\?)\\?(?!\\?)\")\ndef convert_placeholders(sql: str) -> str:\n    return _PLACEHOLDER_RE.sub(\"%s\", sql)\n```\n\n## Result wrapping · 结果包装\n\nAll query results are wrapped in `CaseInsensitiveDict`:\n\n```python\nd = CaseInsensitiveDict({\"Name\": \"Alice\"})\nd[\"name\"]   # \"Alice\"\nd[\"NAME\"]   # \"Alice\"\nd[\"Name\"]   # \"Alice\"\n```\n\n## Four execution modes · 四种执行模式\n\n```python\n# SELECT\nresults = executor.execute_query(\"SELECT * FROM users WHERE status = ?\", \"ACTIVE\")\n\n# UPDATE / INSERT / DELETE\naffected = executor.execute_update(\"UPDATE users SET status = ? WHERE id = ?\", \"INACTIVE\", 1)\n\n# Batch · 批量\nresults = executor.execute_batch([\"INSERT INTO log VALUES (1)\", \"INSERT INTO log VALUES (2)\"])\n\n# Transaction · 事务\nexecutor.execute_transaction(lambda tx: (\n    tx.execute_update(\"UPDATE accounts SET balance = balance - 100 WHERE id = ?\", 1),\n    tx.execute_update(\"UPDATE accounts SET balance = balance + 100 WHERE id = ?\", 2),\n))\n```"},{"path":"references/supported-databases.md","content":"# Supported databases · 支持的数据库\n\nEnglish | [中文](#支持的数据库)\n\n<a id=\"支持的数据库\"></a>\n\n---\n\n## MySQL 8+\n\n| Property | Value |\n|---|---|\n| Driver | `pymysql` |\n| JDBC URL | `jdbc:mysql://<host>:3306/<db>?useSSL=false&charset=utf8mb4` |\n| Placeholder | `?` (auto-converted to `%s`) |\n| Python lib | `pymysql>=1.1.0` |\n| Schema | `SHOW FULL TABLES`, `SHOW FULL COLUMNS`, `SHOW INDEX` |\n\n## PostgreSQL\n\n| Property | Value |\n|---|---|\n| Driver | `psycopg2` |\n| JDBC URL | `jdbc:postgresql://<host>:5432/<db>` |\n| Placeholder | `?` (auto-converted to `%s`) |\n| Python lib | `psycopg2-binary>=2.9.9` |\n| Schema | `information_schema.tables`, `pg_class` |\n\n## Oracle\n\n| Property | Value |\n|---|---|\n| Driver | `oracledb` |\n| JDBC URL | `jdbc:oracle:thin:@<host>:1521/<service>` |\n| Placeholder | `?` (auto-converted to `%s`) |\n| Python lib | `oracledb>=2.0.0` |\n| Schema | `user_tables`, `user_tab_columns` |\n\n## SQL Server\n\n| Property | Value |\n|---|---|\n| Driver | `pymssql` |\n| JDBC URL | `jdbc:sqlserver://<host>:1433;databaseName=<db>` |\n| Placeholder | `?` (auto-converted to `%s`) |\n| Python lib | `pymssql>=2.2.0` |\n| Schema | `information_schema.tables`, `sys.indexes` |\n\n## SQLite\n\n| Property | Value |\n|---|---|\n| Driver | `sqlite3` (built-in) |\n| JDBC URL | `jdbc:sqlite:<path>/file.db` or `jdbc:h2:mem:test` |\n| Placeholder | `?` (auto-converted to `%s`) |\n| Python lib | None (stdlib) |\n| Schema | `sqlite_master`, `PRAGMA table_info` |\n\n## Column name case sensitivity · 列名大小写\n\n| Driver | Native casing | Wrapper |\n|---|---|---|\n| pymysql | lowercase | CaseInsensitiveDict |\n| psycopg2 | lowercase | CaseInsensitiveDict |\n| oracledb | uppercase | CaseInsensitiveDict |\n| pymssql | lowercase | CaseInsensitiveDict |\n| sqlite3 | as-defined | CaseInsensitiveDict |\n\n## Adding a new database · 扩展新数据库\n\n1. Add JDBC URL prefix to `_DRIVER_REGISTRY` in `connection_manager.py`.\n2. Add lazy import function.\n3. Add `_connect()` branch in `ConnectionManager`.\n4. Add schema queries in `SchemaInspector`.\n5. Add dependency to `pyproject.toml`.\n\n1. 在 `connection_manager.py` 的 `_DRIVER_REGISTRY` 中注册 URL 前缀。\n2. 添加惰性导入函数。\n3. 在 `ConnectionManager._connect()` 中添加分支。\n4. 在 `SchemaInspector` 中适配 Schema 查询。\n5. 在 `pyproject.toml` 中添加依赖。"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Python-based database connectivity skill supporting MySQL, PostgreSQL, Oracle, SQL Server, and SQLite. Provides connection management, parameterized query ex... Skill: database_skill Owner: jami-lin Summary: Python-based database connectivity skill supporting MySQL, PostgreSQL, Oracle, SQL Server, and SQLite. Provides connection management, parameterized query ex... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-05-01T16:19:11.957Z | user Initial release of database-skill — a Python-based database connectivity tool. - Supports MySQL, PostgreSQL, Oracle, SQL Server, and SQ","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1010,"uniquenessScore":50,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T01:04:05.405Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T01:04:05.405Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T03:53:31.224Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}