Skip to content
This repository was archived by the owner on May 13, 2023. It is now read-only.

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages