-
Notifications
You must be signed in to change notification settings - Fork 55
Feat 5376 improve the select query #287
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
Changes from all commits
0777736
1ca3476
fedafbf
0278adf
cde877c
b93544f
3a3b51f
e39efe7
60bae57
c4c6e2a
f901305
e61eb13
0313f8c
5fd6373
27364ea
85afec2
4d20bc3
a2d25c4
e480ad8
56dedb3
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 |
|---|---|---|
|
|
@@ -1331,10 +1331,28 @@ protected function getAttributeProjection(array $selections, string $prefix = '' | |
| } | ||
|
|
||
| $projection['_uid'] = 1; | ||
| $projection['_id'] = 1; | ||
| $projection['_permissions'] = 1; | ||
| $projection['_createdAt'] = 1; | ||
| $projection['_updatedAt'] = 1; | ||
|
Comment on lines
1335
to
1336
Member
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. We need to make sure these are not set by default the same as maraidb
Contributor
Author
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. Except _collection and _id rest have to be set because.
Member
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. Can we make it so that they are not required at this point? I think we should be able to if we can do it for MariaDB
Contributor
Author
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. For all adapters _uid and _permissions are a must. MariaDB/MySQL/SQLite: https://github.com/faisalill/database/blob/feat-5376-improve-the-select-query/src/Database/Adapter/MariaDB.php#L1226 Because of this:
Contributor
Author
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. For Postgres I am querying all the internal attributes and if any internal attribute is in the query I am removing it from selection then before the document is returned I check which internal attributes were in the query and only keep those internal attributes in the document. |
||
| $projection['_permissions'] = 1; | ||
|
|
||
| if (isset($projection['$id'])) { | ||
| unset($projection['$id']); | ||
| } | ||
| if (isset($projection['$internalId'])) { | ||
| unset($projection['$internalId']); | ||
| } | ||
| if (isset($projection['$permissions'])) { | ||
| unset($projection['$permissions']); | ||
| } | ||
| if (isset($projection['$createdAt'])) { | ||
| unset($projection['$createdAt']); | ||
| } | ||
| if (isset($projection['$updatedAt'])) { | ||
| unset($projection['$updatedAt']); | ||
| } | ||
| if (isset($projection['$collection'])) { | ||
| unset($projection['$collection']); | ||
| } | ||
|
|
||
| return $projection; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.