Conversation
|
Mongo tests are expected to fail, implementation missing. |
|
Letting the database natively rebuild index (and decide when it needs to do it) is a better solution because:
|
|
Looking at this, it might have been smarter to implement more smaller functions instead of a universal one 🤔 |
Yes, there is also an edge case when index rebuild might be triggered, and query results would depend on how strict MariaDB settings are. Before making this user-faced in Appwrite, we need bigger research (what queries cost more) and separate index-rebuilding-logic from the one that doesn't. For now, for migration purposes, this should be quick and simple solution. Do you want me to work on improving this PR? |
| ->setAttribute('signed', $signed) | ||
| ->setAttribute('array', $array); | ||
|
|
||
| $success = $this->adapter->updateAttribute($collection->getId(), $id, $type, $size, $signed, $array); |
There was a problem hiding this comment.
Don't we want to throw an exception here if something fails?
There was a problem hiding this comment.
It will throw automatically, providing a proper message of what happened. For instance Truncated incorrect INTEGER value: "Matej"
There was a problem hiding this comment.
So, why do we need to keep success?
Let's say it returns false -> indicating that something went wrong. We are still executing all of its remaining code.
There was a problem hiding this comment.
Hmm, I see the confusion now. First, I added return $success as it was missing.
The boolean comes from PDO->execute(). Not sure why it returns a boolean but also throws an exception. Looking at other adapter methods, they all return execute(), so they return a boolean.
There was a problem hiding this comment.
Now we are returning it too early 👍🏻
The PDO has a configuration, where we can set either throw an exception or return false/true. Let's check if its false here and return false. If not just continue. At the bottom we can just return true. That way we make sure, we do actions only when previous steps are successful.
|
Closing PR. Problem addressed in separate PR that makes more developer-friendly interfaces: #132 Most of the code copied from this PR. |
No description provided.