Rename table and column names in your SQL queries based on a CSV mapping file. Useful when working across databases with different naming conventions (e.g. Bronze/Silver tables in a lakehouse architecture).
Usage
Open a file with the sql code in VS Code.
Select the SQL code to rename (or leave empty to rename the entire file).
Press Cmd+R (macOS) / Ctrl+R (Windows/Linux).
The extension replaces names inline and logs any unmapped tables/columns as warnings in the Output.
Installation
Install Python 3 on your machine.
Install the sqlglot library:
pip install sqlglot
Open VS Code Settings (extension icon → ⚙️ Settings) and configure:
SQL Rename: DB Dialect — SQL dialect of your database (e.g. oracle, postgres)
SQL Rename: Mapping CSV Path — path to your mapping file (leave empty for bundled)
SQL Rename: Target Schema — target schema name (leave empty for default)