Skip to content

Commit

Permalink
Log prepared statement
Browse files Browse the repository at this point in the history
  • Loading branch information
bchapuis committed Oct 27, 2023
1 parent 33c7816 commit 5978cd6
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ public ByteBuffer read(TileCoord tileCoord) throws TileStoreException {
statement.setInt(i + 3, tileCoord.y());
}

// Log the sql query
logger.debug("Executing sql for tile {}: {}", tileCoord, statement);

try (ResultSet resultSet = statement.executeQuery();
OutputStream gzip = new GZIPOutputStream(data)) {
while (resultSet.next()) {
Expand Down Expand Up @@ -192,9 +195,8 @@ protected static Query prepareQuery(Tileset tileset, int zoom) {
var tileQueryTail = ") mvtTile";
tileSql.append(tileQueryTail);

// Log the resulting sql
// Format the sql query
var sql = tileSql.toString().replace("\n", " ");
logger.debug("sql: {}", sql);

return new Query(sql, paramCount);
}
Expand Down

0 comments on commit 5978cd6

Please sign in to comment.