-
Notifications
You must be signed in to change notification settings - Fork 3
Joins #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Joins #133
Changes from all commits
1d86a6b
ae04b11
98dd145
01e06cf
6a95abb
f2c5f6a
53ce92c
67c8eda
69ade1c
066bd70
49bddeb
f50c5ad
805bdb8
317e4c9
bfafb18
525ba8c
bc73611
fb8378a
fd6b9bc
4030ff3
daa5f17
0a632aa
d115b61
9aeb2d5
ac60b6d
4582154
db744ef
6817db3
b1c5095
63df4dd
3a33326
e60685a
7b1750f
19feff6
b41b305
32da357
c030a2a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -26,7 +26,7 @@ | |||||
| "ext-curl": "*", | ||||||
| "ext-openssl": "*", | ||||||
| "appwrite/appwrite": "19.*", | ||||||
| "utopia-php/database": "5.*", | ||||||
| "utopia-php/database": "dev-joins8 as 5.3.1", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line uses leading spaces instead of the 8-space indentation consistent with the surrounding lines in
Suggested change
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||||||
| "utopia-php/storage": "1.0.*", | ||||||
| "utopia-php/dsn": "0.2.*", | ||||||
| "halaxa/json-machine": "^1.2" | ||||||
|
|
||||||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1100,6 +1100,11 @@ private function exportRecords(string $entityName, string $fieldName, int $batch | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $selects = ['*', '$id', '$permissions', '$updatedAt', '$createdAt']; // We want relations flat! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| foreach ($selects as $select) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $queries[] = $this->reader->querySelect($select); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $manyToMany = []; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($this->reader->getSupportForAttributes()) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -1118,22 +1123,22 @@ private function exportRecords(string $entityName, string $fieldName, int $batch | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $queries[] = $this->reader->querySelect($selects); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $response = $this->reader->listRows($table, $queries); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| foreach ($response as $row) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // HACK: Handle many to many (only for schema-based databases) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!empty($manyToMany)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $stack = ['$id']; // Adding $id because we can't select only relations | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $queries = []; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $queries[] = $this->reader->querySelect('$id'); // Adding $id because we can't select only relations | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| foreach ($manyToMany as $relation) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $stack[] = $relation . '.$id'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $queries[] = $this->reader->querySelect($relation . '.$id'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $rowItem = $this->reader->getRow( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $table, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $row['$id'], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [$this->reader->querySelect($stack)] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $queries | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1131
to
1142
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Inside the
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| foreach ($manyToMany as $key) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -414,12 +414,12 @@ public function getRow(TableResource $resource, string $rowId, array $queries = | |||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| /** | ||||||||||||||||||
| * @param array $columns | ||||||||||||||||||
| * @param string $column | ||||||||||||||||||
| * @return Query | ||||||||||||||||||
| */ | ||||||||||||||||||
| public function querySelect(array $columns): Query | ||||||||||||||||||
| public function querySelect(string $column): Query | ||||||||||||||||||
| { | ||||||||||||||||||
| return Query::select($columns); | ||||||||||||||||||
| return Query::select($column); | ||||||||||||||||||
| } | ||||||||||||||||||
fogelito marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
421
to
423
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
| /** | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
utopia-php/databasedependency is pointing todev-joins8 as 5.3.1, a development branch alias. This is not suitable for merging tomain— the branch may be unstable, subject to breaking changes, or may be deleted. The dependency should be updated to a stable release constraint (e.g.5.*) once thedev-joins8changes are merged and tagged upstream.