Download the PHP package baddum/sql418 without Composer
On this page you can find all versions of the php package baddum/sql418. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download baddum/sql418
More information about baddum/sql418
Files in baddum/sql418
Package sql418
Short Description A library to extend SQL requests
License MIT
Homepage https://github.com/Baddum/SQL418
Informations about the package sql418
SQL418
SQL418
is a small PHP library for extensible SQL requests.
This library allows you to modify an existing SQL statement, by overriding some parts of it.
- Features
- Use cases
- How to Install
- How to Contribute
- Author & Community
Features
Use the extend()
method to complete a request.
An example to add a WHERE
clause to a SELECT
request:
You can override a defined part of a request.
An example to change the selected fields:
Use the &
keyword to extend a part of a request.
An example to add a field to select:
You can change the type of a request.
An example to change a SELECT
request to a DELETE
one:
You can also use all the features together:
Use cases
Use case: DRYer requests
In the following example, the fetchById
and deleteById
requests share a common pattern:
Use case: extensible applications
In the following example, we extend the UserModel
to do a soft delete:
How to Install
This library package requires PHP 5.4
or later.
Install Composer and run the following command to get the latest version:
How to Contribute
- Star the project!
- Tweet and blog about SQL418 and Let me know about it.
- Report a bug that you find
- Pull requests are highly appreciated. Please review the guidelines for contributing to go further.
Author & Community
SQL418 is under MIT License.
It was created & is maintained by Thomas ZILLIOX.