2017 © Pedro Peláez
 

library parrotdb

PHP object database

image

annoraaq/parrotdb

PHP object database

  • Sunday, January 28, 2018
  • by Annoraaq
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ParrotDb

ParrotDb is an open source object database written in PHP., (*1)

Please note this is a fun project and not intended for use in production. It is rather a proof of concept. However, feel free to check out the benchmark section of the wiki to get a first impression of performance., (*2)

ParrotDb comes with an own query language as well as an own text file format., (*3)

Installation

git clone https://github.com/Annoraaq/ParrotDb.git, (*4)

composer install, (*5)

Run tests

vendor/bin/phpunit, (*6)

Basic usage

Let's say we have an example class:, (*7)

class Bird
{
    public $id;
    public $name;
}

Now we need to create a session, a parser and a persistence manager:, (*8)

$session = \ParrotDb\Core\PSessionFactory::createSession(
  "Testfile",
  \ParrotDb\Core\PSession::DB_XML
);

$parser = new \ParrotDb\Query\LotB\Parser\Parser($session->getDatabase());

$pm = $session->createPersistenceManager();

Insert

$bird = new Bird();
$bird->id = 42;
$bird->name = "Pelecanidae";

$pm->persist($bird);

$pm->commit();

Select

$constraint = $parser->parse('get Bird id = 42');
$resultSet = $pm->query($constraint);
$fetchedBird = $resultSet->first();

Update

$constraint = $parser->parse('get Bird id = 42');
$resultSet = $pm->query($constraint);
$fetchedBird = $resultSet->first();
$fetchedBird->name = "Pidgeon";
$pm->commit();

Delete

$constraint = $parser->parse('get Bird id = 42');
$pm->delete($constraint);

The Versions

28/01 2018

dev-master

9999999-dev

PHP object database

  Sources   Download

MIT

The Requires

 

by Johannes Baum