Skip to content

Latest commit

 

History

History
45 lines (30 loc) · 2.05 KB

File metadata and controls

45 lines (30 loc) · 2.05 KB

MybatisLogFormatSQL

Build Version Downloads

Installation

  • 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...

How to Use

Basic Usage

  1. Select the entire log output or the relevant SQL portion that contains SQL with parameter placeholders (?) text into your editor or console
  2. Right-click and choose MybatisLogFormatSQL from the context menu
  3. dialog will open displaying the formatted SQL with all ? placeholders replaced with their actual parameter values

Examples

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)