<?php
namespace nulib\cache;

use nulib\db\sqlite\Sqlite;

class SourceDb extends Sqlite {
  const MIGRATION = [
    "create table source (pk integer primary key autoincrement, s varchar(255), i integer, b boolean)",
    [self::class, "fill_data"],
  ];

  static function fill_data(Sqlite $db): void {
    $db->exec("insert into source (s, i, b) values (null, null, null)");
    $db->exec("insert into source (s, i, b) values ('false', 0, 0)");
    $db->exec("insert into source (s, i, b) values ('first', 1, 1)");
    $db->exec("insert into source (s, i, b) values ('second', 2, 1)");
  }

  public function __construct() {
    parent::__construct(__DIR__."/source.db");
  }
}
