Install Now

User Guide

Learn how to effectively use MyBatis SQL Log Merger to transform your debugging workflow

How to Use MyBatis SQL Log Merger

This comprehensive guide will walk you through all the features and capabilities of the MyBatis SQL Log Merger extension. Whether you're a beginner or an experienced user, you'll find valuable tips to enhance your productivity.

1

Installation

Getting started with MyBatis SQL Log Merger is simple:

  1. Visit the Chrome Web Store link provided below
  2. Click "Add to Chrome" to install the extension
  3. Once installed, you'll see the extension icon in your Chrome toolbar
  4. Click the icon to open the extension popup

Pro Tip

You can pin the extension to your toolbar for quick access by clicking the puzzle piece icon in Chrome, finding MyBatis SQL Log Merger, and selecting the pin icon.

2

Activating the Injection Button

MyBatis SQL Log Merger offers a convenient way to extract SQL directly from any webpage by injecting a button into the page. Here's how to activate this feature:

  1. Navigate to the target website where you want to use the extraction feature
  2. Click the MyBatis SQL Log Merger icon in the Chrome toolbar
  3. In the popup window, click the "Inject SQL Extraction Button" toggle next to the inactive status indicator
  4. The status will change to "Active" and the page will refresh to show the extraction button
  5. You'll now see a green button in the bottom-right corner of the page

Pro Tip

  • You can also configure URL patterns in the Settings page to automatically activate the button on multiple websites.
  • You can configure SQL websites in the Settings page to enable Quick Navigation.
3

Using the Injection Button to Extract SQL

Once activated, you can easily extract SQL from any selected MyBatis logs on the page:

  1. Select the MyBatis log text on the webpage
  2. Click the green "Extract SQL" button that appears in the bottom-right corner
  3. View the merged SQL result in the popup panel
  4. Use the "Copy" button to copy the SQL to your clipboard

If you want to manually enter SQL templates and parameters, click the expand icon next to the extraction button:

  1. Click the "⋯" icon next to the extraction button
  2. Enter the SQL template and parameters in the popup panel
  3. Click "Parse" to generate the result

Note

The injection button feature works with the same log formats as the standalone mode, supporting both formats with and without Preparing: and Parameters: prefixes.

4

Using Single Mode

Single Mode is ideal when you have complete MyBatis logs in one place:

  1. Open the extension popup by clicking the toolbar icon
  2. Ensure you're in Single Mode (indicated by the active tab)
  3. Copy your MyBatis logs from your application console or log files
  4. Paste the logs into the large text area
  5. Click the "Process SQL" button to generate executable SQL
  6. Your formatted SQL will appear in the results section
  7. Use the "Copy Result" button to copy the SQL to your clipboard

Note

Single Mode works with logs that contain both the SQL template and parameters in one continuous block. It supports logs with or without "Preparing:" and "Parameters:" prefixes.

5

Using Dual Mode

Dual Mode is perfect when your SQL templates and parameters are in separate locations:

  1. Switch to Dual Mode using the toggle button
  2. In the first text area, paste your SQL template (with or without "Preparing:" prefix)
  3. In the second text area, paste your parameters (with or without "Parameters:" prefix)
  4. Click the "Process SQL" button to combine them into executable SQL
  5. Your formatted SQL will appear in the results section
  6. Use the "Copy Result" button to copy the SQL to your clipboard

Note

Dual Mode gives you more control over the input and is especially useful when copying from different sources or when logs are fragmented.

6

Advanced Features

Take advantage of these powerful features to enhance your workflow:

  • SQL Formatting: Automatically format your SQL for better readability with the "Beautify SQL" button
  • Syntax Highlighting: Color-coded SQL makes it easier to identify different elements
  • One-Click Copy: Instantly copy your results to the clipboard
  • Clear Function: Reset all fields with the "Clear" button
  • Responsive Design: Works seamlessly on desktops, tablets, and mobile devices

Pro Tip

After generating your SQL, you can further refine it using the beautify feature to make complex queries more readable.

Single Mode vs Dual Mode

Single Mode

  • Best for complete, continuous logs
  • Simple copy-paste workflow
  • Works with standard MyBatis output
  • Supports prefixed and non-prefixed logs
  • Ideal for quick conversions

Dual Mode

  • Perfect for fragmented logs
  • Separate template and parameters
  • More control over input
  • Works with prefixed and non-prefixed inputs
  • Great for complex debugging scenarios

Frequently Asked Questions

What MyBatis log formats are supported?

Our extension supports both standard MyBatis log formats and logs with "Preparing:" and "Parameters:" prefixes. It works with DEBUG level logs that show the SQL template and parameter values. Both single-line and multi-line formats are supported.

Is my data secure when using this extension?

Absolutely! All processing happens locally in your browser. No data is sent to any servers, ensuring your sensitive SQL queries and log information remain completely private. Your data never leaves your computer.

Why am I getting incorrect SQL output?

This usually happens when the log format isn't correctly recognized. Make sure you're using the appropriate mode (Single or Dual) for your log structure. Also, check that your logs contain both the SQL template and parameter information. If issues persist, try cleaning up the log text by removing extra spaces or line breaks.

Can I use this for production database queries?

While technically possible, we recommend using this tool primarily for development and debugging purposes. Always ensure you have proper authorization before running any queries against production databases. The generated SQL is meant for analysis and testing, not direct production use.