feat: 准备支持fluent sql

This commit is contained in:
wangyu 2024-07-04 18:04:41 +08:00
parent 58bdc3276b
commit 67db4da315
2 changed files with 47 additions and 0 deletions

View File

@ -33,5 +33,10 @@
<groupId>dev.flyfish.framework</groupId>
<artifactId>flyfish-data-common</artifactId>
</dependency>
<dependency>
<groupId>group.flyfish.framework</groupId>
<artifactId>fluent-sql-core</artifactId>
<version>0.0.5</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,42 @@
package dev.flyfish.framework.r2dbc.operations;
import group.flyfish.fluent.chain.common.ExecutableSql;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/**
* 我们为实际开发提供了响应式链避免写sql
*
* @author wangyu
*/
public interface R2dbcFluentOperations {
/**
* 查询单个
*
* @param sql 可执行sql
* @param <T> 泛型
* @return 结果
*/
<T> Mono<T> findOne(ExecutableSql sql);
/**
* 查询单个
*
* @param sql 可执行sql
* @param <T> 泛型
* @return 结果
*/
<T> Flux<T> find(ExecutableSql sql);
/**
* 查询分页对象
*
* @param sql 可执行sql
* @param <T> 泛型
* @return 结果
*/
<T> Mono<Page<T>> find(ExecutableSql sql, Pageable pageable);
}