2017 © Pedro Peláez
 

library nosqlite

Simple key => value store based on SQLite3

image

mthenw/nosqlite

Simple key => value store based on SQLite3

  • Wednesday, January 21, 2015
  • by mthenw
  • Repository
  • 3 Watchers
  • 43 Stars
  • 1,464 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 6 Forks
  • 1 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

NoSQLite – simple key => value store based on SQLite3

Build Status Coverage Status Latest Stable Version, (*1)

Introduction

NoSQLite is simple key-value store using SQLite as raw data store. Mainly for small project where MySQL is too heavy and files are too ugly., (*2)

Requirements

  • PHP >=5.3.2
    • PDO (by default as of PHP 5.1.0)
    • PDO_SQLITE (by default as of PHP 5.1.0)

Installing via Composer

Get composer and add following lines to composer.json:, (*3)

{
    "require": {
        "mthenw/nosqlite": "*@stable"
    }
}

Usage

  1. Create stores' manager (file will be created if not exists), (*4)

    $nsql = new NoSQLite\NoSQLite('mydb.sqlite');
  2. Get store, (*5)

    $store = $nsql->getStore('movies');
  3. Set value in store (key and value max length are limited by SQLite TEXT datatype), (*6)

    $store->set(uniqid(), json_encode(array('title' => 'Good Will Hunting', 'director' => 'Gus Van Sant')));
  4. Get value from store (will be created if not exists), (*7)

    $store->get('3452345');
  5. Get all values, (*8)

    $store->getAll();
  6. Delete all values, (*9)

    $store->deleteAll();
  7. Iterate through store (Store implements Iterator interface), (*10)

    foreach($store as $key => $value)
        ...
  8. Get number of values in store (Store implements Countable interface), (*11)

    count($store);

Tests

Tests are written in PHPUnit which is required as a dev package in composer.json. For running test use, (*12)

./vendor/bin/phpunit

or simply, (*13)

make test

The Versions

21/01 2015

dev-master

9999999-dev https://github.com/mthenw/nosqlite.php

Simple key => value store based on SQLite3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

database persistence sqlite3

26/09 2013

v0.3.0

0.3.0.0 https://github.com/mthenw/nosqlite.php

Simple key => value store based on SQLite3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

database persistence sqlite3

30/05 2013

v0.2.2

0.2.2.0 https://github.com/mthenw/nosqlite.php

Simple key => value store based on SQLite3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

database persistence sqlite3

29/03 2012

v0.2.1

0.2.1.0 https://github.com/mthenw/nosqlite.php

Simple key => value store based on SQLite3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

database persistence sqlite3

09/02 2012

v0.2.0

0.2.0.0 https://github.com/mthenw/nosqlite-php

Simple key => value store based on SQLite3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

database persistence sqlite3