userbase
userbase copied to clipboard
Question: Why does the database owner need to open the database with the databaseName
I have been wondering for some time why a database owner has to open their own databases with the name of the database. When opening a database, you must always check whether the user is the owner of the database or not. I understand why users who are not owners of a database cannot open it by name, but why can't an owner open the database using the ID? From a developer experience point of view, for me personally it would simplify a lot to always be able to open a database with the ID regardless of whether the user is the owner of the database or not.
Valid question.
This was a precautionary measure that the internals of the SDK rely on to be extremely confident a user's database can't be corrupted when a developer calls openDatabase on an already open database, or when a user's connection to a database drops and reconnects.
It's possible to do and we'd like to do it - it will require a non-negligible amount of structural changes to the SDK to be sure it's safe in the above circumstances.
Will keep open until implemented.