Preview MyBatis-Plus Wrapper SQL in the IDE Without Restarting the App

Developers using MyBatis-Plus often must restart their application and read console logs just to see the SQL a LambdaQueryWrapper produces. The article explains that conditional clauses, logical-delete injection, and paging queries stay hidden until runtime, making this edit-run-read loop slow. It outlines three approaches: joining logged Preparing and Parameters lines into an executable statement, statically previewing SQL by parsing source code in the IDE, and capturing real JDBC activity from a running JVM. The author notes each suits different tasks, such as code review, performance investigation, or reconstructing production logs. The piece is written by the author of a plugin called MyBatis SQL Visualizer, which the author discloses.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in