wicksome / mybatis-log-to-sql

πŸ”¨ Convert query log with params to SQL

Home Page:https://wickso.me/tools/mybatis-log-to-sql/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Convert mybatis's log to SQL

Warning
move to https://github.com/wicksome/TIL/blob/main/tools/mybatis-log-to-sql (link)

npm version

Replace all ? characters to parameters.

demo

https://wickso.me/mybatis-log-to-sql/

AS-IS

2017-10-08 17:39:34 [DEBUG](BaseJdbcLogger.java:159) ==>  Preparing: SELECT * FROM table WHERE id = ?
2017-10-08 17:39:34 [DEBUG](BaseJdbcLogger.java:159) ==> Parameters: 2001(Integer)

TO-BE

SELECT * FROM table WHERE id = 2001

CLI

Install

$ git clone https://github.com/wicksome/mybatis-log-to-sql.git
$ cd mybatis-log-to-sql && npm init

Usage

$ node index.js
>> SQL: 2017-10-08 17:39:34 [DEBUG](BaseJdbcLogger.java:159) ==>  Preparing: SELECT * FROM table WHERE id = ?
>> Parameters: 2017-10-08 17:39:34 [DEBUG](BaseJdbcLogger.java:159) ==> Parameters: 2001(Integer)
--------------------------------------------------------------------------------
SELECT * FROM table WHERE id = 2001
βœ” Copy sql!

About

πŸ”¨ Convert query log with params to SQL

https://wickso.me/tools/mybatis-log-to-sql/


Languages

Language:HTML 66.5%Language:JavaScript 33.5%