Boost MyBatis Development with MyBatis SQL Viewer: Install, Use, and Stress‑Test Your SQL
The MyBatis SQL Viewer plugin streamlines MyBatis development by converting XML to real SQL, offering parameter mocking, compliance and index checks, execution, stress testing, and both MyBatis and non‑MyBatis modes, all without repeatedly restarting the application.
Introduction
mybatis‑sql‑viewer plugin provides capabilities such as converting MyBatis XML to real SQL, parameter mocking, SQL compliance checking, index analysis, execution, stress testing, and scanning.
Problems Addressed
SQL errors require application restart.
Mocking data for tests is cumbersome.
Uncertainty about SQL standards compliance, index usage, and performance.
Installation
IDEA Marketplace: search "mybatis sql viewer" and install.
Manual: download the latest zip from the releases page and install from disk.
Usage
Configure a datasource first; the plugin offers two modes.
Non‑MyBatis Mode
Write SQL directly in the Statement tab; the plugin validates syntax and compliance.
MyBatis Mode
Click the "sql" icon in mapper interfaces or XML files to generate mock parameters, then convert the XML to real SQL.
Features
SQL syntax validation.
Compliance checking against Alibaba Java Development Manual.
Index analysis and execution‑plan generation.
SQL execution with result set, execution info, and plan.
Stress testing with configurable concurrency, duration, and parameter models.
Stress‑test report showing TPS, latency percentiles, success rate, and more.
Table, schema, and index tabs for detailed inspection of tables, fields, and indexes.
Data mocking with various rules (random, lexicon, fixed, increment, regex, etc.) and preview.
Mock data cleanup to avoid polluting real test data.
Configuration
Preferences → Tools → Mybatis Sql Viewer.
Project Address
https://github.com/linyimin0812/mybatis-sql-viewer
Java Backend Technology
Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
