PQL

PQL - PHP Query Language, Database Query Library

This library is a database abstraction layer which abstracts the query commands (Select, Delete, Update, etc.) out from the drivers (MySQL, Postgres, SQL Server, etc.). Queries are defined in an eloquent way allowing you to write almost all kinds of queries without having to rely on passing raw query data.

Installation

Installation is done via composer composer install arekxv/pql

Usage

The easiest way to start is to let PdoDatabase resolve the driver and the builder for you from the DSN and give you a ready to use runner:

use ArekX\PQL\Drivers\Pdo\PdoDatabase;

$runner = PdoDatabase::resolve([
    'dsn' => 'mysql:host=127.0.0.1;dbname=your_database',
    'username' => 'username',
    'password' => 'password',
]);

See Getting Started for a full walkthrough.

Guides

Drivers

Following systems are supported:

  • MySQL - MySQL database via PDO
  • PostgreSQL - PostgreSQL database via PDO
  • SQLite - SQLite database via PDO
  • SQL Server - Microsoft SQL Server database via PDO

Testing

After installing the dependencies run composer test

For coverage report run composer coverage or you can take a look at it here.