luna-duclos / instrumentedsql

A sql driver that will wrap any other driver and log/trace all its calls
MIT License
173 stars 44 forks source link

add ability to exclude OpSQL values from tracing #19

Closed lwsanty closed 5 years ago

lwsanty commented 5 years ago

Earlier there was only an option to turn on/off TraceRowsNext.

This pr adds an ability to exclude several OpSQL... options if needed

const (
    OpSQLPrepare         = "sql-prepare"
    OpSQLConnExec        = "sql-conn-exec"
    OpSQLConnQuery       = "sql-conn-query"
    OpSQLStmtExec        = "sql-stmt-exec"
    OpSQLStmtQuery       = "sql-stmt-query"
    OpSQLStmtClose       = "sql-stmt-close"
    OpSQLTxBegin         = "sql-tx-begin"
    OpSQLTxCommit        = "sql-tx-commit"
    OpSQLTxRollback      = "sql-tx-rollback"
    OpSQLResLastInsertID = "sql-res-lastInsertId"
    OpSQLResRowsAffected = "sql-res-rowsAffected"
    OpSQLRowsNext        = "sql-rows-next"
    OpSQLPing            = "sql-ping"
    OpSQLDummyPing       = "sql-dummy-ping"
)
luna-duclos commented 5 years ago

Very nice change, breaking, but I feel the API change is trivial enough noone should have any issues adapting. Thank you very much for this!