-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathConnectionAdapter.php
More file actions
44 lines (32 loc) · 979 Bytes
/
ConnectionAdapter.php
File metadata and controls
44 lines (32 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php declare(strict_types=1);
namespace Cspray\DatabaseTesting\ConnectionAdapter;
use Cspray\DatabaseTesting\DatabaseRepresentation\Table;
use Cspray\DatabaseTesting\Fixture\Fixture;
/**
* @api
* @template UnderlyingConnection of object
*/
interface ConnectionAdapter {
public function establishConnection() : void;
public function closeConnection() : void;
/**
* @return UnderlyingConnection
*/
public function underlyingConnection() : object;
public function beginTransaction() : void;
public function rollback() : void;
/**
* @param non-empty-string $table
* @return void
*/
public function truncateTable(string $table) : void;
/**
* @param non-empty-list<Fixture> $fixtures
*/
public function insert(array $fixtures) : void;
/**
* @param non-empty-string $name
* @return list<array<non-empty-string, mixed>>
*/
public function selectAll(string $name) : array;
}