Download the PHP package coolms/rql-doctrine without Composer

On this page you can find all versions of the php package coolms/rql-doctrine. 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 rql-doctrine

coolms/rql-doctrine

CI Latest Version PHP

Doctrine ORM translator for coolms/rql. Walks the RQL AST onto a QueryBuilder and hands back a paginated result, including JSON field filtering that works across six database platforms.

coolms/rql is the pure layer: two grammars, one immutable AST, a field whitelist. It deliberately ships no translator, so that it depends on nothing. This is that translator.

Installation

Requires PHP ^8.5, doctrine/orm ^3.0, doctrine/dbal ^4.0 and Symfony ^8.0. The Symfony floor is 8 rather than 7 because this package requires PHP 8.5, and Symfony 7 emits PHP 8.4 deprecations under it.

Symfony

Register the bundle:

That is enough for a single-manager application. If your entity manager is not called default, name it, or the JSON DQL functions land on a manager that does not exist and go missing at query time rather than at build time:

Without Symfony, construct the visitor yourself and register the DQL functions listed below on your ORM configuration.


What you get

Service Purpose
DoctrineRqlVisitor walks the AST onto a QueryBuilder; apply(), applyFilters(), applySort()
AbstractDoctrineJsonVisitor JSON path filtering, resolved to the platform you are connected to
DynamicFieldSqlTypeResolver looks up the declared SQL type of a JSON field so casts line up with the index

Operators

Every operator in coolms/rql's FilterOp is translated. cn/bw/ew compare LOWER(col) LIKE :v against an already lower-cased value, so they are case-insensitive as the AST expects.

Relation traversal one level deep (identifiers.value) becomes a correlated EXISTS subquery rather than a join, so a filter cannot multiply rows.

JSON fields

A field like extras.price is filtered through the platform visitor. Each platform emits SQL byte-compatible with the generated column its schema manager creates, so a query uses the indexed column instead of re-extracting the JSON:

Platform Visitor
PostgreSQL PostgreSQLDoctrineJsonVisitor
MySQL MySQLDoctrineJsonVisitor
MariaDB MariaDBDoctrineJsonVisitor
SQLite SQLiteDoctrineJsonVisitor
SQL Server SQLServerDoctrineJsonVisitor
Oracle OracleDoctrineJsonVisitor

Selection happens once, at container build time, from the connected platform. MariaDB is matched before MySQL because MariaDBPlatform extends MySQLPlatform in DBAL 4 and the two emit different JSON SQL.

These DQL functions are registered for you by the bundle:

Contributing predicates

A module can add filtering for fields the entity does not own, without touching any repository. Implement FilterPredicateContributorInterface; the bundle tags it and the visitor picks it up:

The visitor is the single funnel every repository's RQL passes through, so a contributor needs no constructor change anywhere.

Outside Symfony, tag manually with coolms.rql_doctrine.filter_predicate_contributor.

Security

Field access is enforced by coolms/rql's RqlContext, not here. A field missing from the whitelist throws before this package sees it. Do not pass a context built from client input.

Writing your own translator

If you need a different ORM, the AST is the contract and one trap is worth knowing: the boolean-group branch must be exhaustive over FilterOp. A group builder that returns nothing for some operators does not error, it silently drops that alternative out of the OR and returns the wrong rows. Assert on the generated query text rather than the row count.

License

MIT © Dmitry Popov


All versions of rql-doctrine with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
coolms/rql Version ^1.0
doctrine/orm Version ^3.0
doctrine/dbal Version ^4.0
symfony/config Version ^8.0
symfony/dependency-injection Version ^8.0
symfony/http-kernel Version ^8.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 coolms/rql-doctrine contains the following files

Loading the files please wait ...