搜索

PythonReactSEOPDF
OpenClaw

database-schema-differ

Compare database schemas across environments, generate migration scripts, and track schema evolution.

derick0010 来源安装数☆ 0 仓库 Starsv1.0.0

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install derick001/database-schema-differ

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

Database Schema Differ

What This Does

A CLI tool to compare database schemas across different environments (development, staging, production), generate migration scripts, and track schema evolution over time. Support for PostgreSQL, MySQL, SQLite, and other databases via SQLAlchemy.

Key features:

  • Schema comparison: Compare schemas between databases, branches, or points in time
  • Migration generation: Automatically generate SQL migration scripts (up/down) for schema changes
  • Schema snapshots: Capture and store schema snapshots for historical comparison
  • Drift detection: Identify schema drift between environments (dev vs prod, etc.)
  • Multiple database support: PostgreSQL, MySQL, SQLite, SQL Server, Oracle via SQLAlchemy
  • Export formats: Generate SQL, JSON, or visual diff outputs
  • Integration ready: Works with Alembic, Django migrations, or standalone
  • Change tracking: Track schema evolution over time with versioning
  • CI/CD friendly: Output machine-readable formats for automation pipelines

When To Use

  • You need to compare database schemas between development and production
  • You want to generate migration scripts for schema changes
  • You're managing multiple database environments and need to ensure consistency
  • You need to detect schema drift in production databases
  • You're refactoring databases and need to track changes
  • You want to automate schema validation in CI/CD pipelines
  • You need to document schema changes for compliance or team coordination
  • You're onboarding new team members and need to understand schema evolution
  • You want to visualize schema differences between branches or versions

Usage

Basic commands:

# Compare two database connections
python3 scripts/main.py compare postgresql://user:pass@host1/db postgresql://user:pass@host2/db

# Generate migration script from schema differences
python3 scripts/main.py diff dev_db.sql prod_db.sql --output migration.sql

# Create schema snap...

来源信息

Source
github
Repository
openclaw/skills
Path
skills/derick001/database-schema-differ
Version
1.0.0
Commit
48eeb585c9f8ba9dddde5ecef34871e6bc586058
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

README

Database Schema Differ

Compare database schemas across environments, generate migration scripts, and track schema evolution.

Features

  • Compare schemas between databases, SQL files, or schema snapshots
  • Generate SQL migration scripts (up/down) for schema changes
  • Detect schema drift between environments
  • Support for PostgreSQL, MySQL, SQLite, and other databases via SQLAlchemy
  • Multiple output formats (SQL, JSON, HTML visual diff)
  • Schema snapshotting for historical comparison

Quick Start

# Compare two databases
python3 scripts/main.py compare postgresql://user:pass@host1/db postgresql://user:pass@host2/db

# Generate migration from schema differences
python3 scripts/main.py diff schema_v1.sql schema_v2.sql --output migration.sql

# Create schema snapshot
python3 scripts/main.py snapshot postgresql://user:pass@host/db --save snapshot.json

# Check for schema drift in CI
python3 scripts/main.py check-drift --expected expected.json --actual actual.json --fail-on-drift

Installation

This skill requires Python 3.x and SQLAlchemy:

pip3 install sqlalchemy alembic psycopg2-binary pymysql

Database-specific drivers:

  • PostgreSQL: psycopg2-binary
  • MySQL: pymysql
  • SQLite: Built into Python
  • SQL Server: pyodbc
  • Oracle: cx_oracle

Usage Examples

Compare development and production
python3 scripts/main.py compare \
  postgresql://dev:pass@localhost/dev_db \
  postgresql://prod:pass@prod-host/prod_db \
  --output diff.json
Generate visual HTML diff
python3 scripts/main.py visual-diff schema1.sql schema2.sql --html diff.html
Track schema changes over time
python3 scripts/main.py history postgresql://user:pass@host/db --days 30 --format timeline

Output Formats

  • Human-readable: Color-coded terminal output
  • JSON: Machine-readable for automation
  • SQL: Ready-to-execute migration scripts
  • HTML: Interactive visual diff in browser

Limitations

  • Requ...

来源内容

SKILL.md
# Database Schema Differ

## What This Does

A CLI tool to compare database schemas across different environments (development, staging, production), generate migration scripts, and track schema evolution over time. Support for PostgreSQL, MySQL, SQLite, and other databases via SQLAlchemy.

Key features:
- **Schema comparison**: Compare schemas between databases, branches, or points in time
- **Migration generation**: Automatically generate SQL migration scripts (up/down) for schema changes
- **Schema snapshots**: Capture and store schema snapshots for historical comparison
- **Drift detection**: Identify schema drift between environments (dev vs prod, etc.)
- **Multiple database support**: PostgreSQL, MySQL, SQLite, SQL Server, Oracle via SQLAlchemy
- **Export formats**: Generate SQL, JSON, or visual diff outputs
- **Integration ready**: Works with Alembic, Django migrations, or standalone
- **Change tracking**: Track schema evolution over time with versioning
- **CI/CD friendly**: Output machine-readable formats for automation pipelines

## When To Use

- You need to compare database schemas between development and production
- You want to generate migration scripts for schema changes
- You're managing multiple database environments and need to ensure consistency
- You need to detect schema drift in production databases
- You're refactoring databases and need to track changes
- You want to automate schema validation in CI/CD pipelines
- You need to document schema changes for compliance or team coordination
- You're onboarding new team members and need to understand schema evolution
- You want to visualize schema differences between branches or versions

## Usage

Basic commands:

```bash
# Compare two database connections
python3 scripts/main.py compare postgresql://user:pass@host1/db postgresql://user:pass@host2/db

# Generate migration script from schema differences
python3 scripts/main.py diff dev_db.sql prod_db.sql --output migration.sql

# Create schema snap...
README
# Database Schema Differ

Compare database schemas across environments, generate migration scripts, and track schema evolution.

## Features

- Compare schemas between databases, SQL files, or schema snapshots
- Generate SQL migration scripts (up/down) for schema changes
- Detect schema drift between environments
- Support for PostgreSQL, MySQL, SQLite, and other databases via SQLAlchemy
- Multiple output formats (SQL, JSON, HTML visual diff)
- Schema snapshotting for historical comparison

## Quick Start

```bash
# Compare two databases
python3 scripts/main.py compare postgresql://user:pass@host1/db postgresql://user:pass@host2/db

# Generate migration from schema differences
python3 scripts/main.py diff schema_v1.sql schema_v2.sql --output migration.sql

# Create schema snapshot
python3 scripts/main.py snapshot postgresql://user:pass@host/db --save snapshot.json

# Check for schema drift in CI
python3 scripts/main.py check-drift --expected expected.json --actual actual.json --fail-on-drift
```

## Installation

This skill requires Python 3.x and SQLAlchemy:

```bash
pip3 install sqlalchemy alembic psycopg2-binary pymysql
```

Database-specific drivers:
- PostgreSQL: `psycopg2-binary`
- MySQL: `pymysql`
- SQLite: Built into Python
- SQL Server: `pyodbc`
- Oracle: `cx_oracle`

## Usage Examples

### Compare development and production
```bash
python3 scripts/main.py compare \
  postgresql://dev:pass@localhost/dev_db \
  postgresql://prod:pass@prod-host/prod_db \
  --output diff.json
```

### Generate visual HTML diff
```bash
python3 scripts/main.py visual-diff schema1.sql schema2.sql --html diff.html
```

### Track schema changes over time
```bash
python3 scripts/main.py history postgresql://user:pass@host/db --days 30 --format timeline
```

## Output Formats

- **Human-readable**: Color-coded terminal output
- **JSON**: Machine-readable for automation
- **SQL**: Ready-to-execute migration scripts
- **HTML**: Interactive visual diff in browser

## Limitations

- Requ...

相关技能

OpenClaw

1password

daggerkun007

Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.