Length aware paginator enables you to paginate Diesel queries and have information about the length of data being paginated. It will give you total number of items, and last page that you can navigate to and still get some kind of data.
You will only have to provide page and per_page parameters.
use PgConnection; use Connection; use QueryDsl; use ; use ; /// Get the database connection /// *panics* if no DATABASE_URL is defined in the env or if the db is unreachable // schema.rs : autogenerated by diesel after running migration table! // user.rs : your model for the table represented in schema.rs
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.