Download the PHP package jonasraoni/query-builder-extensions without Composer

On this page you can find all versions of the php package jonasraoni/query-builder-extensions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package query-builder-extensions

Extensions for the Laravel Illuminate\Database\Query\Builder.

Currently only provides extensions to make it easier to work with paged result sets. Both methods don't buffer the result set, so once a page is consumed, a new query will be issued to retrieve the next page.

The package also has a safer method to count records (getCount()), which is supposed to work faster (by dropping ORDER BY clause) and be more reliable (works with GROUP BY clauses) than the Laravel's count() method.

Safely count records with the getCount()

If you've got a SELECT field FROM test GROUP BY field, the Laravel's count() will convert it to SELECT COUNT(0) FROM test GROUP BY field, which might retrieve N records. Laravel will retrieve only the value for the first record, which will break user expectations.

This getCount() method will instead generate a SELECT COUNT(0) FROM (SELECT 0 FROM test GROUP BY field) which will retrieve the proper record count.

Lazy Paginator

Retrieves a generator that will run through all the records of every page (broken by $rows).

The method will not touch your query, it's just a helper, so you must add the sorting by yourself.

Dynamic Paginator

It does the same as the previous method... But:

So I think it's great to be used when processing a large result set, as you can consume the data on demand without having much issues due to updates.

Details

To avoid skipping/reprocessing past records, the code keeps track of the last processed record in the page.

array $sortMap

This argument is used to tell the paginator which fields should be used to sort, and also to help it retrieving the key values for the last record (so it knows what to skip in the next page...).

Requirements

PS: In case it's not clear, here's an example of the issue you might face when using a standard paging method:

General Usage

Install the package:

The package just has one class (JonasRaoni\QueryBuilder\Extensions) which can be used in two ways:

A. Macro extensions

Call the extend method, to extend all Builder instances:

B. Calling the methods directly


All versions of query-builder-extensions with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jonasraoni/query-builder-extensions contains the following files

Loading the files please wait ....