Skip to content

Releases: usedamru/sql2nosql

v0.1.0 – SQL → NoSQL analysis & migration scripts

06 Feb 09:06

Choose a tag to compare

Highlights

  • 🔍 PostgreSQL schema analysis

    • Introspects tables, columns, primary keys, uniques, and foreign keys via information_schema.
    • Builds a typed internal SqlSchema model.
  • 📦 Deterministic NoSQL schema proposals

    • Generates NoSqlSchema with collections, fields, and references.
    • Writes per-table JSON files under output/analyze/ and LLM-optimized versions under output/recommend/.
  • 🧠 Optional LLM recommendations (OpenAI)

    • @s2n/llm package with OpenAI provider.
    • Suggests embedding/denormalization strategies and insights.
    • Integrated into CLI via --llm, --llm-api-key, --llm-model.
  • 🌐 HTML reports

    • output/view/index.html – main landing page.
    • Per-table HTML pages showing SQL vs NoSQL side-by-side.
    • Includes LLM recommendations when enabled.
  • 🧩 Migration script generation

    • For each table, generates output/scripts/<table>.migrate.js with a build<Table>Doc(row, related) mapper.
    • Generates run-all.migrate.js to list all per-table scripts in dependency order.
    • Scripts are designed to be wired into your own Postgres → MongoDB runner.

Quickstart

# Clone the repo
git clone https://github.com/data-migration/sql2nosql.git
cd sql2nosql

# Install dependencies
yarn install

# Build core + CLI
yarn build

# Create config from template and fill in values
cp sql2nosql.config.example.json sql2nosql.config.json
# Edit sql2nosql.config.json with your Postgres + MongoDB + (optional) OpenAI details

# Run analysis (with optional LLM)
yarn analyze --llm --llm-model gpt-4.1-mini

Next steps

  • Open output/view/index.html in your browser to explore the analysis.
  • Inspect output/scripts/*.migrate.js to review or customize per-table migration mappers.