Download the PHP package soyuka/esql without Composer

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

PHP Extended SQL

PHP Extended SQL is an alternative to the also-known DQL (Doctrine Query Language). It combines the flexibility of SQL with the powerful Doctrine metadata to give you more control over queries.

read this blog article to see it in action.

API Platform bridge

This package comes with an API Platform bridge that supports filters and pagination. To use our bridge, use the esql attribute:

This will automatically enable the use of:

You can find examples of Filtering.

FAQ

Wait did you just re-create DQL?

No. This library offers shortcuts to redundant operations when writing SQL using Doctrine's metadata. We still benefit from Doctrine's metadata and you can still use it to manage your Schema or fixtures.

What about Eloquent or another ORM?

It's planned to add support for Eloquent or other ORM systems once the API is stable enough.

Which Database Management Systems are supported?

With this library you write native SQL. All our helpers will output strings that are useable in the standard SQL specification and therefore should be supported by every relational DBMSusing SQL. The API Platform bridge is tested with SQLite and Postgres. It's only a matter of time to add tests for MariaDB and Mysql.

Are there any limitations or caveats?

You'll still write SQL so I guess not? The only thing noticeable is that binded parameters will take the name of the fields prefixed by :. For example identifier() will output alias.identifier_column = :identifier_fieldname. Our FilterParser uses unique parameters names.

What is the Mapper all about?

The Mapper maps arrays received via the PHP Data Objects (PDO) statement to plain PHP objects also known as Entities. This is why Object Relation Mapping is all about. Internally we're using JanePHP's automapper or Symfony's serializer.

What about writes on the API Platform bridge?

Write support, extended to how Doctrine does is is rather complex especially if you want to support embed writes (write relation at the same time as the main entity). It is possible but there's not much benefits in adding this on our bridge. However you can use some of our helpers to do updates and inserts.

A simple update:

Same goes for inserting value:

Note that if you used a sequence you'd need to handle that yourself.

Documentation

Doctrine

An ESQL instance offers a few methods to help you write SQL with the help of Doctrine's metadata. To ease there use inside HEREDOC calling __invoke($classOrObject) on the ESQL class will return an array with the following closure:

More advanced utilities are available as:

This are useful to build filters, write systems or even a custom mapper.

ESQL works using aliases and mapping them to classes and their properties. When working on relation you'll have to use:

This way, ESQL knows to map the Model to the Car->model property. When working with DTOs the relation may not be found and you can alias the relation yourself:

The full interface is available as ESQLInterface.

Mapping

Automapper

The ESQLMapper transforms an array retrieved via the PDOStatement fetch or fetchAll methods to the corresponding PHP Objects.

There's also a Mapper built with the symfony/serializer.

Bundle configuration

Paginator

API Platform has great defaults for pagination. Using Soyuka\ESQL\Bridge\ApiPlatform\DataProvider\DataPaginator, fetching data would look like this:

If you want to handle the pagination yourself, we provide a way to do so:

Examples


All versions of esql with dependencies

PHP Build Version
Package Version
Requires phpmyadmin/sql-parser Version ^5.4
jms/parser-lib Version ^1.0
symfony/dependency-injection Version ^6.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 soyuka/esql contains the following files

Loading the files please wait ....