60 lines
1.2 KiB
PHP
60 lines
1.2 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace alveolata\database;
|
||
|
|
||
|
// require_once(DIR_ALVEOLATA . '/definitions.php');
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
interface interface_database
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* shall return the terminal symbol used for indicating auto incrementation for a column
|
||
|
*
|
||
|
* @return string
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
public function terminal_autoincrement(
|
||
|
) : string
|
||
|
;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* shall return the definition for a field, which is meant to be an integer typed primary key with auto increment
|
||
|
* setting
|
||
|
*
|
||
|
* @return string
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
public function boilerplate_field_definition_for_integer_primary_key_with_auto_increment(
|
||
|
) : string
|
||
|
;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* shall send a query to the database
|
||
|
*
|
||
|
* @param string $template an SQL query string with placeholders of the form ":name"
|
||
|
* @param array $arguments record values to insert for the placeholders
|
||
|
* @return array {
|
||
|
* record<
|
||
|
* rows:list<map<string,any>>,
|
||
|
* id:(null|integer),
|
||
|
* affected:integer
|
||
|
* >
|
||
|
* }
|
||
|
* @author Christian Fraß <frass@greenscale.de>
|
||
|
*/
|
||
|
public function query(
|
||
|
string $template,
|
||
|
array $arguments = []
|
||
|
) : array
|
||
|
;
|
||
|
|
||
|
}
|
||
|
|
||
|
?>
|