deemru / triples
Simple SQLite layer
1.0.10
2024-07-26 10:00 UTC
Requires
- php: >=5.4
- ext-pdo_sqlite: *
README
Triples implements a simple flexible layer for SQLite storage.
- Speed
- Merge through cache
- Custom queries
Usage
$dbpath = __DIR__ . '/triples.sqlite'; $triples = new Triples( $dbpath, 'triples', true, [ 'INTEGER PRIMARY KEY', 'TEXT UNIQUE', 'INTEGER' ], [ 0, 0, 1 ] ); $r0 = 1; $r1 = 'Hello, World!'; $r2 = crc32( $r1 ); $rec = [ $r0, $r1, $r2 ]; $recs = [ $rec ]; $triples->merge( $recs ); if( $triples->getUno( 2, $r2 )[0] != $r0 || $triples->getUno( 1, $r1 )[2] != $r2 || $triples->getUno( 0, $r0 )[1] !== $r1 ) exit( 1 );
Requirements
- PHP >= 5.4
- SQLite (PDO)
Installation
Require through Composer:
{ "require": { "deemru/triples": "1.0.*" } }