PHPackages                             addiks/phpsql - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. addiks/phpsql

ActiveLibrary[Database &amp; ORM](/categories/database)

addiks/phpsql
=============

SQL-database written in PHP

v0.3.2(9y ago)141481[4 issues](https://github.com/addiks/phpsql/issues)1GPL-3.0PHPPHP &gt;=5.5.0

Since Nov 22Pushed 8y ago2 watchersCompare

[ Source](https://github.com/addiks/phpsql)[ Packagist](https://packagist.org/packages/addiks/phpsql)[ Docs](http://addiks.net/phpsql)[ RSS](/packages/addiks-phpsql/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (1)Versions (12)Used By (1)

Addiks PHP-SQL Database
=======================

[](#addiks-php-sql-database)

[![Build Status](https://camo.githubusercontent.com/5a8371cc1dd247ca3955b2f22a8b4a9f86ef0127a29ebbde271566eefb19372c/68747470733a2f2f7472617669732d63692e6f72672f616464696b732f70687073716c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/addiks/phpsql)

This projects's goal is to create an SQL-compliant database completely written in PHP. It's purposes are wide ranged:

- It can be used to mock a temporary in-memory database for unit-tests.
- A developer can debug directly from the application into the database to see why the db behaves like it does.
- The SQL-Parser can be used to extract valuable information from external SQL-queries.
- This database does not depend on php-modules or a seperate server, it just works.
- The obligatory learning-by-doing purpose

```
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !!!                                                        !!!
 !!!                         WARNING                        !!!
 !!!                                                        !!!
 !!!   DO NOT USE THIS DATABASE IN PRODUCTION ENVIRONMENT!  !!!
 !!!                                                        !!!
 !!!            If you do disregard this warning,           !!!
 !!! you alone are responsible for any damage or data-loss! !!!
 !!!                                                        !!!
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

```

I currently use phpsql only as an in-memory database. While in theory it can also work on the filesystem (for in-memory databases, it mocks an in-memory filesystem), that is currently mostly untested.

Installation:
=============

[](#installation)

There are several ways to install PHPSQL. The recommended way of installation is using composer.

Using composer:
---------------

[](#using-composer)

Add the following to the **require**-area your **composer.json** require-area:

```
    "require": {
        "addiks/phpsql": "^0.1.0"
    },
```

Then [install or update your requirements using composer](https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies)

Git:
----

[](#git)

- Clone the URL **** into any directory.
- Include the file **bin/bootstrap.php** in PHP.

Archive download
----------------

[](#archive-download)

- Download the URL **** into any directory.
- Include the file **bin/bootstrap.php** in PHP.

How to use:
===========

[](#how-to-use)

PHPSQL provides an PDO replacement, which should be used to instanciate the database.

This PDO replacement can be used just like [PHP's PDO class](http://php.net/pdo).

```
