Database Connectivity Skill for Openclaw

A versatile Python-based skill for AI agents to connect, query, and manage relational databases across multiple platforms.

jami-lin
v1.0.0
May 2, 2026
0
1.1k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install dbskill

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install dbskill using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Database Connectivity Skill?

The Database Connectivity Skill provides a robust interface for AI agents to interact with relational databases including MySQL, PostgreSQL, Oracle, SQL Server, and SQLite. As a high-performance component of the Openclaw Skills ecosystem, it enables seamless connection management, schema introspection, and complex transaction control directly through Python scripts. This skill ensures that your AI coding agents can read from and write to databases securely, making it an essential tool for data-driven automation, backend development tasks, and enterprise workflows.

Database Connectivity Skill Use Cases

  • Running parameterized SQL queries to safely fetch or modify data.
  • Introspecting database schemas to identify tables, columns, and primary keys.
  • Managing multi-step database transactions with automated commit and rollback support.
  • Automating database maintenance and migration tasks using CLI-based Openclaw Skills.
  • Integrating relational data into AI agent workflows for generating dynamic, data-aware responses.

How Database Connectivity Skill Works

  1. The user provides database credentials via CLI arguments, environment variables, or a pre-configured YAML file.
  2. The skill initializes a connection using the appropriate Python driver tailored for the target database system.
  3. Users execute SQL commands through the query executor, which handles parameter binding to prevent injection.
  4. The schema inspector can be triggered to retrieve metadata about the database structure for exploration.
  5. Connection metadata is optionally persisted locally (excluding passwords) to allow the Openclaw Skills agent to reconnect quickly in future sessions.

Database Connectivity Skill Setup

To use this skill, ensure you have Python 3.8+ and install the necessary database drivers for your target environment:

pip install pymysql psycopg2-binary oracledb pymssql pyyaml

You can then run a quick connectivity test or list tables using the following command:

python scripts/main.py --url "jdbc:mysql://localhost:3306/mydb" --user "root" --password "${DB_PASS}" --tables

Database Connectivity Skill Data Schema & Taxonomy

The skill organizes its operations and persistence based on the following structure:

Component Description
Connection Store Saves non-sensitive data (URL, user, driver) to %TEMP%/.database-skill-connections.json.
Query Executor Logic for executing SELECT, UPDATE, and multi-statement batch files.
Schema Metadata Dictionary-based mapping of table structures, column types, and foreign key relationships.
CaseInsensitiveDict A wrapper for query results ensuring column access is not case-sensitive.

Database Connectivity Skill Advanced Features

  • Case-insensitive result mapping allowing flexible data access (e.g., row["ID"] matches row["id"]).
  • Batch execution mode for processing large SQL files efficiently using the --batch flag.
  • Transaction management API with lambda-based execution for reliable atomic operations.
  • Persistent connection history within the Openclaw Skills environment to simplify multi-database management.
  • Support for multiple drivers including PyMySQL, Psycopg2, and OracleDB for broad compatibility.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*