We felt like it was time to give those stuck on MySQL databases the ability to experience NoSQL. FireSql is a PHP library that gives you the ability to forget about database schemas all together! Simply connect to a database using
PDO, pass it into FireSql, and start creating collections.
<?php $pdo = new PDO('sqlite:' . __DIR__ . '/demo.db'); $db = new \UA1Labs\Fire\Sql($pdo); // get any collection $collection = $db->collection('CollectionName'); // insert any object $obj = (object) [ 'any' => 'object' ]; // inserting objects return the actual object inserted with meta data attached $obj = $collection->insert($obj); // get the ID from the inserted object $id = $obj->__id; // update an object $obj->updated = true; // update the object $collection->update($id, $obj); // or delete the object $collection->delete($id);
Why Build NoSQL Funcitonality On a Relational Database?
The problem with most relationtional databases is the fact the their schemas get in the way of you being able to be swift in making changes to data structures. One of the major problems with maintaining relationtional databases is the fact that when you update schemas, you also need to issue, and manage, update scripts that could break systems if they are installed in the incorrect order or fail to run all together. It can become costly to maintain these systems. FireSql was created for those who want to continue using their SQL databases, but not have to worry about schemas anymore.
We created FireSql because we saw a need where many developers manage WordPress sites/plugins/themes, where they rely on data. At no cost or technical debt, we wanted to give them the ability to start creating projects without worrying about data schemas.
- Github: https://github.com/ua1-labs/firesql
- Composer: https://packagist.org/packages/ua1-labs/firesql