-
Using the IDE built-in plugin system:
Settings/Preferences > Plugins > Marketplace > Search for "MybatisLogFormatSQL" > Install
-
Using JetBrains Marketplace:
Go to JetBrains Marketplace and install it by clicking the Install to ... button in case your IDE is running.
You can also download the latest release from JetBrains Marketplace and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...
-
Manually:
Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...
- Select the entire log output or the relevant SQL portion that contains SQL with parameter placeholders (
?) text into your editor or console - Right-click and choose MybatisLogFormatSQL from the context menu
- dialog will open displaying the formatted SQL with all
?placeholders replaced with their actual parameter values
MyBatis Log:
==> Preparing: INSERT INTO orders(user_id, product, qty, price, note) VALUES (?, ?, ?, ?, ?)
==> Parameters: 1001(Long), Widget(String), 3(Integer), 9.99(BigDecimal), null(String)
Formatted SQL:
INSERT INTO orders(user_id, product, qty, price, note) VALUES (1001, 'Widget', 3, 9.99, NULL)