Performance tuning done

This commit is contained in:
2026-07-23 11:53:40 +05:30
parent 4cbd510b85
commit dcb40473da
2155 changed files with 652296 additions and 230 deletions

View File

@@ -0,0 +1,32 @@
package com.cygnus.cloud.database;
import io.vertx.sqlclient.Pool;
import io.vertx.sqlclient.Row;
import io.vertx.sqlclient.RowSet;
import io.vertx.sqlclient.Tuple;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;
/**
* Reactor boundary around the Vert.x PostgreSQL pool. Feature repositories
* should use parameterized SQL and pass values through {@link Tuple}.
*/
@Service
public class ReactiveDatabaseClient {
private final Pool pool;
public ReactiveDatabaseClient(Pool pool) {
this.pool = pool;
}
public Mono<RowSet<Row>> query(String sql) {
return Mono.fromCompletionStage(() -> pool.query(sql).execute().toCompletionStage());
}
public Mono<RowSet<Row>> preparedQuery(String sql, Tuple parameters) {
return Mono.fromCompletionStage(
() -> pool.preparedQuery(sql).execute(parameters).toCompletionStage());
}
}