54 lines
1.4 KiB
PHP
54 lines
1.4 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace alveolata\database;
|
||
|
|
||
|
// require_once(DIR_ALVEOLATA . '/definitions.php');
|
||
|
require_once(DIR_ALVEOLATA . '/database/abstract/interface.php');
|
||
|
require_once(DIR_ALVEOLATA . '/database/implementation-sqlite/functions.php');
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
class implementation_sqlite implements interface_database
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* @var struct_subject_sqlite
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
private $subject;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
private function __construct(struct_subject_sqlite $subject) {$this->subject = $subject;}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
public static function make(
|
||
|
string $path,
|
||
|
int $verbosity = 0
|
||
|
) : implementation_sqlite
|
||
|
{
|
||
|
$subject = sqlite_make($path, $verbosity);
|
||
|
return (new implementation_sqlite($subject));
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* implementations
|
||
|
*
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
public function terminal_autoincrement() : string {return sqlite_terminal_autoincrement();}
|
||
|
public function boilerplate_field_definition_for_integer_primary_key_with_auto_increment() : string {return sqlite_boilerplate_field_definition_for_integer_primary_key_with_auto_increment();}
|
||
|
public function query(string $template, array $arguments = []) : array {return sqlite_query($this->subject, $template, $arguments);}
|
||
|
|
||
|
}
|
||
|
|
||
|
?>
|