-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathReader.php
More file actions
111 lines (98 loc) · 2.8 KB
/
Reader.php
File metadata and controls
111 lines (98 loc) · 2.8 KB
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
<?php
namespace Utopia\Migration\Sources\Appwrite;
use Utopia\Database\Query;
use Utopia\Migration\Resource;
use Utopia\Migration\Resources\Database\Database;
use Utopia\Migration\Resources\Database\Table;
/**
* @template QueryType
*/
interface Reader
{
/**
* Get information about the resources currently on the source
*
* @param array $resources
* @param array $report
* @param array<string, array<string>> $resourceIds
* @return mixed
*/
public function report(array $resources, array &$report, array $resourceIds = []): mixed;
/**
* List databases that match the given queries
*
* @param array<QueryType> $queries
* @return array
*/
public function listDatabases(array $queries = []): array;
/**
* List collections that match the given queries
*
* @param Database $resource
* @param array $queries
* @return array
*/
public function listTables(Database $resource, array $queries = []): array;
/**
* List attributes that match the given queries
*
* @param Table $resource
* @param array<QueryType> $queries
* @return array
*/
public function listColumns(Table $resource, array $queries = []): array;
/**
* List indexes that match the given queries
*
* @param Table $resource
* @param array<QueryType> $queries
* @return array
*/
public function listIndexes(Table $resource, array $queries = []): array;
/**
* List documents that match the given queries
*
* @param Table $resource
* @param array<QueryType> $queries
* @return array
*/
public function listRows(Table $resource, array $queries = []): array;
/**
* Get a document by its ID in the given collection
*
* @param Table $resource
* @param string $rowId
* @param array $queries
* @return array
*/
public function getRow(Table $resource, string $rowId, array $queries = []): array;
/**
* Return a query to select the given attributes
*
* @param string $column
* @return QueryType|string
*/
public function querySelect(string $column): mixed;
/**
* Return a query to filter the given attributes
*
* @param string $column
* @param array $values
* @return QueryType|string
*/
public function queryEqual(string $column, array $values): mixed;
/**
* Return a query to paginate after the given resource
*
* @param Resource|string $resource
* @return QueryType|string
*/
public function queryCursorAfter(Resource|string $resource): mixed;
/**
* Return a query to limit the number of results
*
* @param int $limit
* @return QueryType|string
*/
public function queryLimit(int $limit): mixed;
}