-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SQLxPagination requires a single connection instead of a complete pool (
#35) This pull request includes significant changes to the `page-hunter` project, primarily focusing on modifying the `SQLxPagination` to require a single connection instead of a connection pool. This update affects multiple files and introduces breaking changes. Additionally, the version has been updated to `0.5.0`. ### Breaking Changes: * `README.md`, `page-hunter/src/lib.rs`: Updated examples to use `PgConnection` instead of `PgPool`, and added instructions for acquiring a single connection from a pool before running `paginate`. [[1]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L204-R205) [[2]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L216-R216) [[3]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L227-R233) [[4]](diffhunk://#diff-98b36862e570e602d4e1243b2002ed62181ef1e476b652e63f282f1a700f59a9L184-R185) [[5]](diffhunk://#diff-98b36862e570e602d4e1243b2002ed62181ef1e476b652e63f282f1a700f59a9L196-R196) [[6]](diffhunk://#diff-98b36862e570e602d4e1243b2002ed62181ef1e476b652e63f282f1a700f59a9L207-R213) * [`page-hunter/CHANGELOG.md`](diffhunk://#diff-796b552e2e17042f9cdc871a10c457777b7e0cdcf342074efc6c4fd37bac24b6R8-R13): Documented the breaking change that `SqlxPagination` now requires a single connection instead of a connection pool. [[1]](diffhunk://#diff-796b552e2e17042f9cdc871a10c457777b7e0cdcf342074efc6c4fd37bac24b6R8-R13) [[2]](diffhunk://#diff-796b552e2e17042f9cdc871a10c457777b7e0cdcf342074efc6c4fd37bac24b6L18-R24) [[3]](diffhunk://#diff-796b552e2e17042f9cdc871a10c457777b7e0cdcf342074efc6c4fd37bac24b6L29-R35) * [`page-hunter/Cargo.toml`](diffhunk://#diff-b66be18f3a8e4dacb33abd0fd4152b1ddd61f79ed96a368ac193112c1d525834L4-R4): Updated the version to `0.5.0`. ### Codebase Updates: * `examples/axum/src/db/repository/categories.rs`, `examples/axum/src/db/repository/products.rs`: Modified to acquire a single connection from the pool before running `paginate`. [[1]](diffhunk://#diff-224cd2775e8c94344ba22aa730ebb2a0b407a1382252965f7b9eb338346b9962R76-R79) [[2]](diffhunk://#diff-1b85346dad9f26c7812d76958fd4f36cfd9681c950b2c26eab2ba579269b56c6R127-R130) * [`page-hunter/src/pagination/sqlx/queries.rs`](diffhunk://#diff-cc5ef0715780e23c1d25b1c22fe34ab45f9d7b746fa36bbad1f0866632d75d1cR1-R5): Refactored `get_total_rows`, `get_page_rows`, and `paginate_rows` functions to use a SQL query string instead of `QueryBuilder`. Updated `SQLxPagination` trait and its implementation accordingly. [[1]](diffhunk://#diff-cc5ef0715780e23c1d25b1c22fe34ab45f9d7b746fa36bbad1f0866632d75d1cR1-R5) [[2]](diffhunk://#diff-cc5ef0715780e23c1d25b1c22fe34ab45f9d7b746fa36bbad1f0866632d75d1cL13-R21) [[3]](diffhunk://#diff-cc5ef0715780e23c1d25b1c22fe34ab45f9d7b746fa36bbad1f0866632d75d1cL28-R30) [[4]](diffhunk://#diff-cc5ef0715780e23c1d25b1c22fe34ab45f9d7b746fa36bbad1f0866632d75d1cL42-R49) [[5]](diffhunk://#diff-cc5ef0715780e23c1d25b1c22fe34ab45f9d7b746fa36bbad1f0866632d75d1cL59-R58) [[6]](diffhunk://#diff-cc5ef0715780e23c1d25b1c22fe34ab45f9d7b746fa36bbad1f0866632d75d1cL93-R108) [[7]](diffhunk://#diff-cc5ef0715780e23c1d25b1c22fe34ab45f9d7b746fa36bbad1f0866632d75d1cL126-L129) [[8]](diffhunk://#diff-cc5ef0715780e23c1d25b1c22fe34ab45f9d7b746fa36bbad1f0866632d75d1cL140-R130) [[9]](diffhunk://#diff-cc5ef0715780e23c1d25b1c22fe34ab45f9d7b746fa36bbad1f0866632d75d1cL150-R162) * [`page-hunter/src/pagination/sqlx/tests/test_pg.rs`](diffhunk://#diff-e7fff6a6fe680c789203aa0bea2dd87ddffda8bc9c8d2773885438b16ba4190dL7-R8): Updated tests to use `PgConnection` and acquire a single connection from the pool before running `paginate`. [[1]](diffhunk://#diff-e7fff6a6fe680c789203aa0bea2dd87ddffda8bc9c8d2773885438b16ba4190dL7-R8) [[2]](diffhunk://#diff-e7fff6a6fe680c789203aa0bea2dd87ddffda8bc9c8d2773885438b16ba4190dL35-R49) [[3]](diffhunk://#diff-e7fff6a6fe680c789203aa0bea2dd87ddffda8bc9c8d2773885438b16ba4190dL102-R109) [[4]](diffhunk://#diff-e7fff6a6fe680c789203aa0bea2dd87ddffda8bc9c8d2773885438b16ba4190dL150-R154)
- Loading branch information
Showing
8 changed files
with
82 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "page-hunter" | ||
description = "The pagination powerhouse, built with Rust" | ||
version = "0.4.2" | ||
version = "0.5.0" | ||
authors = ["Juan Manuel Tamayo <[email protected]>"] | ||
edition = "2021" | ||
repository = "https://github.com/jmtamayo/page-hunter" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.