Marketplace sql-to-osc
install
source · Clone the upstream repo
git clone https://github.com/aiskillstore/marketplace
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/aiskillstore/marketplace "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/dennisliuck/sql-to-osc" ~/.claude/skills/aiskillstore-marketplace-sql-to-osc && rm -rf "$T"
manifest:
skills/dennisliuck/sql-to-osc/SKILL.mdsource content
SQL to OSC Conversion Expert
Convert Flyway SQL migration scripts to OSC format following project conventions.
Quick Reference
OSC Format:
{database}<TAB>{table}<TAB>{operations};
| SQL | OSC |
|---|---|
| Remove (db in column 1) |
| Remove (tbl in column 2) |
| |
| |
| |
| Multiple operations | Comma-joined, no space |
Conversion Workflow
- Read source SQL from
src/main/resources/db/migration/ - Parse statements: Extract database, table, operations
- Transform:
- Remove
andUSE
wrappersALTER TABLE - Convert
→NULLDEFAULT NULL - Convert
→CREATE INDEX...ON tableADD INDEX... - Uppercase data types
- Remove
- Format output:
{db}\t{table}\t{op1},{op2},...; - Write to
(e.g.,src/main/resources/db/osc/osc-{YYYYMMDD}.txt
)osc-20251212.txt
Output Requirements
- Encoding: UTF-8 (no BOM)
- Line ending: LF (
)\n - Separator: TAB (
) between columns\t - Operations: Comma (
) joined, NO space after comma, - Line ending: Semicolon (
);
Example
Input (
V1.0__alter_my_table.sql):
USE mydb; ALTER TABLE MY_TABLE ADD COLUMN NEW_COL bigint(20) NULL AFTER EXISTING_COL; CREATE INDEX MY_TABLE_NEW_COL_IDX ON MY_TABLE (NEW_COL);
Output (
osc-{YYYYMMDD}.txt):
mydb MY_TABLE ADD COLUMN NEW_COL BIGINT(20) DEFAULT NULL AFTER EXISTING_COL,ADD INDEX MY_TABLE_NEW_COL_IDX (NEW_COL);
Conversion Summary Template
✓ 轉換完成 來源: {source_file} 輸出: src/main/resources/db/osc/osc-{YYYYMMDD}.txt 影響資料表: {tables} 操作統計: - ADD COLUMN: {count} - ADD INDEX: {count} - MODIFY COLUMN: {count}