/
ClickHouseRepositoryInterface.php
118 lines (110 loc) · 3.9 KB
/
ClickHouseRepositoryInterface.php
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
namespace Borislav\Clickhouse\Repository\Interfaces;
use Borislav\Clickhouse\Client\Response\Interfaces\ClickHouseResponseInterface;
use Borislav\Clickhouse\Entity\Interfaces\ClickHouseEntityInterface;
use Borislav\Clickhouse\Exception\ClickHouseBadRequestException;
use Borislav\Clickhouse\Exception\ClickHouseConfigNotFoundException;
use Borislav\Clickhouse\Exception\ClickHouseDenormalizationException;
use Borislav\Clickhouse\Exception\ClickHouseEntityNotFoundException;
use Borislav\Clickhouse\Exception\ClickHouseMappingException;
use Borislav\Clickhouse\Exception\ClickHouseNormalizationException;
use Borislav\Clickhouse\Exception\ClickHouseNotImplementedException;
use Borislav\Clickhouse\Exception\ClickHouseReflectionException;
use Borislav\Clickhouse\Exception\ClickHouseTransportException;
interface ClickHouseRepositoryInterface
{
/**
* @param string|int $id
*
* @return ClickHouseEntityInterface|null
*
* @throws ClickHouseConfigNotFoundException
* @throws ClickHouseDenormalizationException
* @throws ClickHouseEntityNotFoundException
* @throws ClickHouseTransportException
* @throws ClickHouseNotImplementedException
* @throws ClickHouseReflectionException
*/
public function find(string|int $id): ClickHouseEntityInterface|null;
/**
* @param array $criteria
* @param array|null $orderBy
* @param int|null $limit
* @param int|null $offset
*
* @return ClickHouseEntityInterface[]
*
* @throws ClickHouseConfigNotFoundException
* @throws ClickHouseDenormalizationException
* @throws ClickHouseEntityNotFoundException
* @throws ClickHouseTransportException
* @throws ClickHouseNotImplementedException
* @throws ClickHouseReflectionException
*/
public function findBy(
array $criteria,
?array $orderBy = null,
?int $limit = null,
?int $offset = null
): array;
/**
* @param array $criteria
*
* @return ClickHouseEntityInterface|null
*
* @throws ClickHouseConfigNotFoundException
* @throws ClickHouseDenormalizationException
* @throws ClickHouseEntityNotFoundException
* @throws ClickHouseTransportException
* @throws ClickHouseNotImplementedException
* @throws ClickHouseReflectionException
*/
public function findOneBy(array $criteria): ClickHouseEntityInterface|null;
/**
* @param array|null $orderBy
*
* @return ClickHouseEntityInterface[]
*
* @throws ClickHouseConfigNotFoundException
* @throws ClickHouseDenormalizationException
* @throws ClickHouseEntityNotFoundException
* @throws ClickHouseTransportException
* @throws ClickHouseNotImplementedException
* @throws ClickHouseReflectionException
*/
public function findAll(?array $orderBy = null): array;
/**
* @param ClickHouseEntityInterface[] $items
*
* @return ClickHouseResponseInterface
*
* @throws ClickHouseBadRequestException
* @throws ClickHouseConfigNotFoundException
* @throws ClickHouseEntityNotFoundException
* @throws ClickHouseMappingException
* @throws ClickHouseNormalizationException
* @throws ClickHouseTransportException
* @throws ClickHouseNotImplementedException
* @throws ClickHouseReflectionException
*/
public function insert(array $items): ClickHouseResponseInterface;
/**
* @param ClickHouseEntityInterface[] $items
* @param bool $isAwaitableQuery
* @see ClickHouseResponseInterface
* @see ClickHouseSyncResponseInterface
*
* @return bool
*
* @throws ClickHouseBadRequestException
* @throws ClickHouseConfigNotFoundException
* @throws ClickHouseDenormalizationException
* @throws ClickHouseEntityNotFoundException
* @throws ClickHouseMappingException
* @throws ClickHouseNormalizationException
* @throws ClickHouseTransportException
* @throws ClickHouseNotImplementedException
* @throws ClickHouseReflectionException
*/
public function update(array $items, bool $isAwaitableQuery = false): bool;
}