1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 21:22:40 +00:00
Arsse/lib/Db/Driver.php

31 lines
1.5 KiB
PHP
Raw Normal View History

<?php
declare(strict_types=1);
2017-03-28 04:12:12 +00:00
namespace JKingWeb\Arsse\Db;
interface Driver {
function __construct(bool $install = false);
2017-02-16 20:29:42 +00:00
// returns a human-friendly name for the driver (for display in installer, for example)
static function driverName(): string;
// returns the version of the scheme of the opened database; if uninitialized should return 0
function schemaVersion(): int;
// return a Transaction object
function begin(): Transaction;
// manually begin a real or synthetic transactions, with real or synthetic nesting
function savepointCreate(): bool;
// manually commit either the latest or all pending nested transactions
function savepointRelease(bool $all = false): bool;
// manually rollback either the latest or all pending nested transactions
function savepointUndo(bool $all = false): bool;
2017-02-16 20:29:42 +00:00
// attempt to advise other processes that they should not attempt to access the database; used during live upgrades
function lock(): bool;
function unlock(): bool;
function isLocked(): bool;
// attempt to perform an in-place upgrade of the database schema; this may be a no-op which always throws an exception
function schemaUpdate(int $to): bool;
2017-02-16 20:29:42 +00:00
// execute one or more unsanitized SQL queries and return an indication of success
function exec(string $query): bool;
// perform a single unsanitized query and return a result set
function query(string $query): Result;
// ready a prepared statement for later execution
function prepare(string $query, ...$paramType): Statement;
}