From eef978fc67fd2dbcadb584aea2c15328db731f15 Mon Sep 17 00:00:00 2001 From: Yongshun Shreck Ye Date: Thu, 14 Nov 2024 23:52:13 +0800 Subject: [PATCH] Add some `@see` references in the KDocs for batch execution --- .../exposedvertxsqlclient/DatabaseClient.kt | 5 ++++- .../exposedvertxsqlclient/sql/DatabaseClientSql.kt | 14 +++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/src/main/kotlin/com/huanshankeji/exposedvertxsqlclient/DatabaseClient.kt b/lib/src/main/kotlin/com/huanshankeji/exposedvertxsqlclient/DatabaseClient.kt index b82985e..8dddea0 100644 --- a/lib/src/main/kotlin/com/huanshankeji/exposedvertxsqlclient/DatabaseClient.kt +++ b/lib/src/main/kotlin/com/huanshankeji/exposedvertxsqlclient/DatabaseClient.kt @@ -290,6 +290,9 @@ class DatabaseClient( suspend fun executeBatchForVertxSqlClientRowSetSequence(statements: Iterable>): Sequence> = executeBatch(statements) { this } + /** + * @see executeBatch + */ @ExperimentalEvscApi suspend inline fun executeBatchQuery( fieldSet: FieldSet, queries: Iterable, crossinline resultRowMapper: ResultRow.() -> Data @@ -310,7 +313,7 @@ class DatabaseClient( */ /** * Executes a batch of update statements, including [InsertStatement] and [UpdateStatement]. - * @see org.jetbrains.exposed.sql.batchInsert + * @see executeBatch * @return a sequence of the update counts of the update statements in the batch. */ suspend fun executeBatchUpdate( diff --git a/lib/src/main/kotlin/com/huanshankeji/exposedvertxsqlclient/sql/DatabaseClientSql.kt b/lib/src/main/kotlin/com/huanshankeji/exposedvertxsqlclient/sql/DatabaseClientSql.kt index 4d2657a..a6e0416 100644 --- a/lib/src/main/kotlin/com/huanshankeji/exposedvertxsqlclient/sql/DatabaseClientSql.kt +++ b/lib/src/main/kotlin/com/huanshankeji/exposedvertxsqlclient/sql/DatabaseClientSql.kt @@ -134,7 +134,9 @@ suspend fun DatabaseClient<*>.selectBatch( ): Sequence> = executeBatchQuery(fieldSet, data.asSequence().map { fieldSet.buildQuery(it) }.asIterable()) - +/** + * @see DatabaseClient.executeBatchUpdate + */ suspend fun DatabaseClient<*>.batchInsert( table: T, data: Iterable, body: T.(InsertStatement, E) -> Unit ) = @@ -143,6 +145,9 @@ suspend fun DatabaseClient<*>.batchInsert( }.asIterable()) .forEach { dbAssert(it == 1) } +/** + * @see DatabaseClient.executeBatchUpdate + */ suspend fun DatabaseClient<*>.batchInsertIgnore( table: T, data: Iterable, body: T.(InsertStatement, E) -> Unit ) = @@ -154,6 +159,7 @@ suspend fun DatabaseClient<*>.batchInsertIgnore( /** * This function is not conventional and it usages are likely to degrade performance. + * @see DatabaseClient.executeBatchUpdate */ @ExperimentalEvscApi suspend fun DatabaseClient<*>.batchInsertSelect( @@ -161,6 +167,10 @@ suspend fun DatabaseClient<*>.batchInsertSelect( ) = executeBatchUpdate(statements) +/** + * @see DatabaseClient.executeBatchUpdate + * @see sortDataAndBatchUpdate + */ suspend fun DatabaseClient<*>.batchUpdate( table: T, data: Iterable, where: BuildWhere? = null, limit: Int? = null, body: T.(UpdateStatement, E) -> Unit ) = @@ -170,6 +180,7 @@ suspend fun DatabaseClient<*>.batchUpdate( /** * @return a sequence indicating whether each update statement is updated in the batch. + * @see batchUpdate */ suspend fun DatabaseClient<*>.batchSingleOrNoUpdate( table: T, data: Iterable, where: BuildWhere? = null, limit: Int? = null, body: T.(UpdateStatement, E) -> Unit @@ -178,6 +189,7 @@ suspend fun DatabaseClient<*>.batchSingleOrNoUpdate( /** * @see sortDataAndExecuteBatch + * @see batchUpdate */ suspend fun > DatabaseClient<*>.sortDataAndBatchUpdate( table: T,