mybatis-sql-log-to-sql

1.0.1 • Public • Published

Convert mybatis's log to SQL

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!

Readme

Keywords

none

Package Sidebar

Install

npm i mybatis-sql-log-to-sql

Weekly Downloads

4

Version

1.0.1

License

MIT

Last publish

Collaborators

  • yeongjun.kim