feat(core): Massive update to Pagination + update Backend functions #168
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new pagination feature to the
geekorm
library, along with several associated changes to support this functionality. The main changes include adding a newPagination
struct, modifying existing methods to support pagination, and updating the documentation and examples to reflect these changes.Pagination Feature:
New Pagination Example:
pagination.rs
demonstrating how to use thechrono
crate withgeekorm
for pagination. (examples/pagination.rs
)Pagination Struct and Methods:
Pagination
struct ingeekorm-core/src/queries/pagination.rs
to handle pagination logic. (geekorm-core/src/queries/pagination.rs
)paginate
,page
, andall
to fetch paginated results ingeekorm-core/src/backends/mod.rs
. (geekorm-core/src/backends/mod.rs
) [1] [2]fetch_all
method in favor of the newall
method. (geekorm-core/src/backends/mod.rs
)Code Refactoring:
Pagination
toPage
ingeekorm-core/src/queries/pages.rs
and updated related methods and documentation. (geekorm-core/src/queries/pages.rs
) [1] [2] [3] [4] [5]Page
in various files. (geekorm-core/src/lib.rs
,geekorm-core/src/queries/builder.rs
,geekorm-core/src/queries/mod.rs
,src/lib.rs
) [1] [2] [3] [4] [5]Error Handling:
PaginationError
variant to theError
enum to handle pagination-specific errors. (geekorm-core/src/error.rs
)Example and Documentation:
Cargo.toml
under the examples section. (Cargo.toml
)These changes collectively enhance the
geekorm
library by adding robust pagination support, improving code organization, and ensuring better error handling.