Skip to content

Commit 7c0329c

Browse files
committed
Don't replace placeholders of ByteArray in query logs
As PostgreSQL already replaces them
1 parent dcb120f commit 7c0329c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/kotlin/io/github/freya022/botcommands/internal/core/db/query/PostgresParametrizedQueryFactory.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import io.github.freya022.botcommands.api.core.db.query.ParametrizedQueryFactory
77
import io.github.freya022.botcommands.api.core.service.annotations.BService
88
import io.github.freya022.botcommands.api.core.service.annotations.Lazy
99
import io.github.oshai.kotlinlogging.KotlinLogging
10+
import java.sql.Array as SqlArray
1011
import java.sql.Connection
1112
import java.sql.DatabaseMetaData
1213
import java.sql.PreparedStatement
13-
import java.sql.Array as SqlArray
1414

1515
@Lazy
1616
@BService
@@ -27,6 +27,7 @@ internal object PostgresParametrizedQueryFactory : ParametrizedQueryFactory<Post
2727
// Attempt to replace those with our own representation
2828
override fun addValue(index: Int, value: Any?) {
2929
if (value == null) return
30+
if (value is ByteArray) return
3031
if (value.javaClass.isArray || value is SqlArray) {
3132
values.put(index, formatParameter(value))
3233
}

0 commit comments

Comments
 (0)