Simple key => value store based on SQLite3

v0.3.0 2013-09-26 19:14 UTC

This package is not auto-updated.

Last update: 2022-06-25 02:09:33 UTC


Build Status Coverage Status Latest Stable Version


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.


  • 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:

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


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

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

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

     $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)

  5. Get all values

  6. Delete all values

  7. Iterate through store (Store implements Iterator interface)

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



Tests are written in PHPUnit which is required as a dev package in composer.json. For running test use


or simply

make test