rosavox/lib/alveolata/database/implementation-postgresql/wrapper-class.php
2025-05-23 07:33:29 +00:00

56 lines
1.5 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-postgresql/functions.php');
/**
* @author Christian Fraß <frass@greenscale.de>
*/
class implementation_postgresql implements interface_database
{
/**
* @var struct_subject_postgresql
* @author Christian Fraß <frass@greenscale.de>
*/
private $subject;
/**
* @author Christian Fraß <frass@greenscale.de>
*/
private function __construct(struct_subject_postgresql $subject) {$this->subject = $subject;}
/**
* @author Christian Fraß <frass@greenscale.de>
*/
public static function make(
string $host,
int $port,
string $schema,
string $username,
string $password
) : implementation_postgresql
{
$subject = postgresql_make($host, $port, $schema, $username, $password);
return (new implementation_postgresql($subject));
}
/**
* implementations
*
* @author Christian Fraß <frass@greenscale.de>
*/
public function terminal_autoincrement() : string {return postgresql_terminal_autoincrement();}
public function boilerplate_field_definition_for_integer_primary_key_with_auto_increment() : string {return postgresql_boilerplate_field_definition_for_integer_primary_key_with_auto_increment();}
public function query(string $template, array $arguments = []) : array {return postgresql_query($this->subject, $template, $arguments);}
}
?>