Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseOpenClawOpenClaw+21 more

    DBMigrator: SQLite to PostgreSQL

    1

    Prevent silent failures and data corruption when migrating applications from SQLite to PostgreSQL.

    $29

    Secure checkout via Stripe

    30-day refund guarantee

    Converts to your local currency at checkout

    Security scanned
    DBMigrator: SQLite to PostgreSQL

    DBMigrator: SQLite to PostgreSQL

    Example session with this skill installed

    My python bot uses aiosqlite. I need to move it to Postgres because the DB locks up with 2k users. Check my db.py for what will break and give me a migration plan.

    • Read your context and instructions
    • Compiled the dbmigrator

    I have analyzed your database layer. Moving from aiosqlite to asyncpg for a high-concurrency bot requires specific changes to handle transaction locking and type strictness.

    Migration Checklist: SQLite to PostgreSQL

    CategorySQLite ConstructPostgreSQL TargetFile/Location
    Driveraiosqliteasyncpgdb.py, main.py
    Placeholders?$1, $2, ...All SQL queries in db.py
    Primary KeysAUTOINCREMENTGENERATED ALWAYS AS IDENTITYusers, messages tables
    BooleansINTEGER (0/1)BOOLEANusers.is_active
    TimestampsTEXTTIMESTAMPTZmessages.sent_at
    ComparisonLIKE (Insensitive)ILIKEUsername search queries

    Required Code Refactoring

    
    # 1. Driver & Connection
    # Change: aiosqlite.connect("bot.db") 
    # To: asyncpg.create_pool(dsn="postgres://user:pass@host/db")
    
    # 2. Query Syntax Example
    # FROM: await db.execute("SELECT * FROM users WHERE id = ?", (user_id,))
    # TO:   await pool.fetchrow("SELECT * FROM users WHERE id = $1", user_id)
    
    # 3. Transaction Handling
    # SQLite often relies on implicit commits. In asyncpg, you must be explicit:
    async with pool.acquire() as conn:
        async with conn.transaction():
            await conn.execute("INSERT INTO logs (data) VALUES ($1)", data)
    
    # 4. Identity Retrieval
    # REPLACE: last_insert_rowid()
    # WITH: INSERT INTO users (name) VALUES ($1) RETURNING id
    

    Next steps

    1. Initialize Staging: Spin up a PostgreSQL 16 Docker container and run a schema migration using the new types.
    2. Data Sync: Use pgloader to migrate existing user records, ensuring 0/1 integers are cast to true/false.

    Switch & Test: Deploy the driver changes to a feature branch and run a load test to verify the "database locked" errors are resolved.

    Connects securely to your tools. The creator never sees your data.

    What you get

    Identify SQLite-specific syntax that will cause silent errors in PostgreSQL.Map SQLite's dynamic types to strict PostgreSQL data types.Refactor driver-specific query placeholders and connection logic.Plan a safe data migration with a verified rollback strategy.

    About this skill

    Moving from a local SQLite file to a production-grade PostgreSQL database is never as simple as changing a connection string. This skill prevents the silent failures that occur when code written for SQLite's loose typing and case-insensitive defaults hits the strict environment of PostgreSQL. It identifies the specific drivers, syntax patterns, and schema constructs in your project that will break during a transition.

    What it does

    • Scans for SQLite dependencies by locating specific driver imports, connection strings, and PRAGMA statements across your codebase.
    • Identifies silent breakers such as AUTOINCREMENT usage, dynamic typing assumptions, and case-sensitive LIKE queries that behave differently in PostgreSQL.
    • Generates type mappings to convert SQLite types, including text-based dates and integer-based booleans, into their native PostgreSQL equivalents.
    • Flags driver-specific syntax changes, specifically the move from ? placeholders to $1 or %s formats required by PostgreSQL drivers.
    • Analyzes transaction semantics to find where implicit commits in SQLite need to be replaced by explicit transaction blocks.

    How it works

    1. Codebase Inventory: The skill performs a deep scan of your database layer to map every SQLite-specific assumption.
    2. Breaker Analysis: It flags specific lines of code that will not throw errors but will return incorrect data types or results after migration.
    3. Migration Roadmap: It produces a structured checklist covering schema mapping, data migration, and driver replacement.
    4. Validation Plan: It provides a specific strategy for parallel testing and result diffing to ensure data integrity.

    Frameworks & tools

    This skill supports migrations for Python (sqlite3, aiosqlite to asyncpg, psycopg) and Node.js (better-sqlite3 to pg, postgres). It targets PostgreSQL 12 through 16.

    Why this beats prompting it yourself

    Generic AI prompts often miss the "silent" bugs like SQLite's case-insensitivity or its lack of a real Boolean type. This skill enforces a strict migration order that prioritizes data integrity and identifies specific technical debt that generic LLM advice ignores.

    Use cases

    • Scaling a Bot: Moving a Telegram or Discord bot from a single-writer SQLite file to a concurrent PostgreSQL instance.
    • Production Readiness: Transitioning a "vibe-coded" MVP to a managed database service like RDS or Supabase.
    • Performance Tuning: Refactoring a project that has outgrown SQLite's locking mechanism and requires row-level locking.

    Known limitations

    Does not perform the actual data transfer (use pgloader for that). Limited to SQLite to PostgreSQL migrations only. Requires read access to the database interaction layer of the codebase.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean 1 day ago

    • Passed all security checks, Safe to install

    Listed1 day ago

    What's inside

    Frequently Asked Questions