C

sql/add-index-before-select

How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

Example of using codemod that changes SQL.
It detects all SELECT statements and adds an index creation statement before them.
Inside SELECT statement for any fields that ends with _id it creates an index on that field.

Example

Before

sql

After

ts

Ready to contribute?

Build your own codemod and share it with the community.