private void flush(PreparedStatement statement) {
      try {
        int pos = 1;
        for (T item : batch) {
          pos = setParamsInStatementForItem(pos, statement, item);
        }
        statement.execute();
        batch.clear();
      } catch (SQLException throwables) {
        throw new IllegalStateException("Error flushing batch", throwables);
      }
    }
Queue-up a write or flush to disk if enough are waiting.
planetiler-core/src/main/java/com/onthegomap/planetiler/mbtiles/Mbtiles.java