Skip to content

Commit 1399246

Browse files
abel533Copilot
andcommitted
docs: 补充 HowToUse 参数文档,新增 5 个缺失参数
新增以下参数说明(中英文同步更新): - asyncCount: 异步 count 查询开关 - asyncCountParallelism: 异步 count 线程池大小 - countSqlParser: 自定义 count SQL 解析器 - orderBySqlParser: 自定义 ORDER BY SQL 解析器 - sqlServerSqlParser: 自定义 SqlServer 分页 SQL 解析器 将已移除的 sqlParser 参数改为删除线+引用格式,说明功能已拆分为三个独立参数。 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0a66c6a commit 1399246

2 files changed

Lines changed: 36 additions & 4 deletions

File tree

wikis/en/HowToUse.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,25 @@ When this parameter is set to `true`, the` offset` parameter in `RowBounds` is u
343343
adding `/*keep orderby*/` to all subqueries and can set it for a single operation in addition to the global
344344
configuration.
345345

346-
21. `sqlParser`: configure JSqlParser parser, attention is `com.github.pagehelper.JSqlParser` interface, used to support
347-
such as essentially a need for additional configuration.(**6.1.0 remove this parameter**)
346+
21. `asyncCount`: Default value is `false`. When set to `true`, count queries will be executed asynchronously,
347+
which can improve overall pagination query efficiency. Can also be set for individual operations in addition to the global configuration.
348+
349+
22. `asyncCountParallelism`: Thread pool size for async count queries, default value is `Runtime.getRuntime().availableProcessors() * 2`.
350+
Only effective when `asyncCount=true`.
351+
352+
23. `countSqlParser`: Configure a custom count SQL parser. Must implement the `com.github.pagehelper.parser.CountSqlParser` interface.
353+
Set to the fully qualified class name of the implementation. Default is `DefaultCountSqlParser`. Replaces the count-related functionality
354+
from the removed `sqlParser` parameter.
355+
356+
24. `orderBySqlParser`: Configure a custom ORDER BY SQL parser. Must implement the `com.github.pagehelper.parser.OrderBySqlParser` interface.
357+
Set to the fully qualified class name of the implementation. Default is `DefaultOrderBySqlParser`.
358+
359+
25. `sqlServerSqlParser`: Configure a custom SqlServer pagination SQL parser. Must implement the `com.github.pagehelper.parser.SqlServerSqlParser` interface.
360+
Set to the fully qualified class name of the implementation. Default is `DefaultSqlServerSqlParser`.
361+
362+
> ~~`sqlParser`: Configure JSqlParser parser, which is the `com.github.pagehelper.JSqlParser` interface, used to support
363+
> sqlserver and other scenarios that need additional configuration. **This parameter was removed in 6.1.0**, and its functionality
364+
> has been split into three separate parameters: `countSqlParser`, `orderBySqlParser`, and `sqlServerSqlParser`.~~
348365
349366
#### 6. How to choose Configure these parameters
350367

wikis/zh/HowToUse.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,23 @@ DEBUG [main] -
301301

302302
20. `keepSubSelectOrderBy`:转换count查询时保留子查询的 order by 排序。可以避免给所有子查询添加 `/*keep orderby*/`,除全局配置外,可以针对单次操作进行设置。
303303

304-
21. `sqlParser`:配置 JSqlParser 解析器,注意是 `com.github.pagehelper.JSqlParser` 接口,用于支持 sqlserver
305-
等需要额外配置的情况(**6.1.0 移除该参数**)。
304+
21. `asyncCount`:默认值为 `false`。设置为 `true` 时,count 查询会异步执行,可以提高分页查询的整体效率。
305+
除全局配置外,也可以针对单次操作进行设置。
306+
307+
22. `asyncCountParallelism`:异步 count 查询的线程池大小,默认值为 `Runtime.getRuntime().availableProcessors() * 2`
308+
仅在 `asyncCount=true` 时有效。
309+
310+
23. `countSqlParser`:配置自定义的 count SQL 解析器,需要实现 `com.github.pagehelper.parser.CountSqlParser` 接口,
311+
配置为实现类的全限定名称。默认使用 `DefaultCountSqlParser`。用于替代已移除的 `sqlParser` 参数中 count 相关的功能。
312+
313+
24. `orderBySqlParser`:配置自定义的 ORDER BY SQL 解析器,需要实现 `com.github.pagehelper.parser.OrderBySqlParser` 接口,
314+
配置为实现类的全限定名称。默认使用 `DefaultOrderBySqlParser`
315+
316+
25. `sqlServerSqlParser`:配置自定义的 SqlServer 分页 SQL 解析器,需要实现 `com.github.pagehelper.parser.SqlServerSqlParser` 接口,
317+
配置为实现类的全限定名称。默认使用 `DefaultSqlServerSqlParser`
318+
319+
> ~~`sqlParser`:配置 JSqlParser 解析器,注意是 `com.github.pagehelper.JSqlParser` 接口,用于支持 sqlserver
320+
> 等需要额外配置的情况。**该参数已在 6.1.0 中移除**,相关功能已拆分为 `countSqlParser``orderBySqlParser``sqlServerSqlParser` 三个独立参数。~~
306321
307322
**重要提示:**
308323

0 commit comments

Comments
 (0)