database
database copied to clipboard
Add Postgres Adapter
Work in progress
Edge cases in Appwrite but not in Utopia
-
Had to change the exception type to ‘Throwable’ instead of ‘PDOException’ for Appwrite as the exception wasn’t getting captured in createDocument and updateDocument methods TODO:
- Add more tests that throw exceptions not caught by PDOException
- Find places where we throw the wrong errors
- Rethrow exceptions that Appwrite can understand
-
There are not enough tests in Utopia to verify that double-quotes were needed around {$attribute} in the find() method to handle reserved words TODO:
- Find specific keywords that break this method
- Automate iteration to test for keywords
- Ex: https://www.drupal.org/docs/develop/coding-standards/list-of-sql-reserved-words#s-reserved-words
- Find more reserved words for different databases, example, https://en.wikipedia.org/wiki/SQL_reserved_words
-
Had to remove all alphanumeric values in getSQLCondition() method. Need to add better edge cases for full-text search in Utopia, it is missing many cases TODO:
- Add more tests to cover similar scenarios in Utopia
- For example email ids etc
- Add tests specific to databases
Improvements needed in Appwrite for future adapters TODO:
- Hardcoded DB names in init.php, realtime.php, worker.php. Create generic interface for all adapters, allowing configurations using env variables
- Add health check method to each adapter
- Had to create a file PostgresSQLStatement.php and override Swoole methods, potentially move it to Utopia in the future
Hey @vermakhushboo , I have started working on adding postgres adapter a few days back. I had created a rfc for the same and had a discussion regarding me starting to work on it on appwrites discord server as well. Are you working on it too?
Hey @vermakhushboo , I have started working on adding postgres adapter a few days back. I had created a rfc for the same and had a discussion regarding me starting to work on it on appwrites discord server as well. Are you working on it too?
Hey @KevinJ-hub, have you made considerable progress on the same? If yes, please take this forward, otherwise, I'd request you to pick something else.
Hey @vermakhushboo , I have started working on adding postgres adapter a few days back. I had created a rfc for the same and had a discussion regarding me starting to work on it on appwrites discord server as well. Are you working on it too?
Hey @KevinJ-hub, have you made considerable progress on the same? If yes, please take this forward, otherwise, I'd request you to pick something else.
Yes, I have started working on it from January. I had a discussion with the appwrite team on their discord server as well regarding me working on this and then on their approval, I started to work on it.
@KevinJ-hub Please create a PR with your changes. The postgres adapter has a high priority at the moment and we want to ensure you have enough time to pick it up. We're expecting to ship it in the coming week. Let us know if you would be able to commit to it 🙂
@KevinJ-hub Please create a PR with your changes. The postgres adapter has a high priority at the moment and we want to ensure you have enough time to pick it up. We're expecting to ship it in the coming week. Let us know if you would be able to commit to it slightly_smiling_face
@christyjacob4 Ohhh, I won't be able to commit on finishing it in a week since I am currently a bit caught up with college work. If thats the case then its fine @vermakhushboo you can please continue with postgres adapter I might pick something else and work on it. 👍
@KevinJ-hub Thank you so much for understanding! Really appreciate the honesty. If you need some guidance on issues you can pick up, please let me know. I'd be happy to assist.
Hello, any update? im heavily relying on relations and this discourages me to use appwrite.
This PR is in an advance stage, and we hope to merge it in a few weeks. Right now we prioritize PRs that address DB reliability and usability before we add major new features.