Is it possible change the default Firebase Realtime Database? - firebase

Is it possible to change the default Firebase Realtime database for an existing Firebase project in any way?
The CLI commands doesn't have this option neither does the web console.
Is it possible somehow to change the default Firebase Realtime database?

Is it possible to change the default Firebase Realtime database for an existing Firebase project in any way?
No, there is not. You cannot change the default location once it was created.
It's possible to create a new database with an alternative location?
Yes, it is possible. You can create a new instance of the Realtime Database that can be located in a totally different location than the others. According to the official documentation of the Realtime Database locations:
If you create a new Realtime Database instance, you're prompted to select the location of the instance in the Firebase console workflow. Each Realtime Database instance in your project can be located in a different location. The currently supported locations for Realtime Database instances are listed below along with their associated database URL schemes.

There isn't any way to change the default realtime database instance as far as I know. You cannot even delete the default instance (it can be disabled though). If you are trying to set another instance as default, you can just export the data as JSON and then import it in the default database instance.

Related

Firestore and data encryption in Flutter

Tl;dr.. I'm making a todo app where I store data in Firestore, and I don't want anyone to see it not even the devs from firebase console. I found many encryption pkgs that do the job, like: encrypt. My problem is how to I handle the 'encryption key'. I don't want to keep it local because in my app user can access it's account from different devices, so if the key is stored locally they cannot decrypt thus retrieve their data (notes) from the other device (i hope this makes sense). So, do I send the 'encryption key' to firestore in a seperate collection or ... how should I approache this ?
You could store the key with Firebase Remote Config and retrieve it in the app when you need it.
Firebase Remote Config is a cloud service that lets you change the
behavior and appearance of your app without requiring users to
download an app update. When using Remote Config, you create in-app
default values that control the behavior and appearance of your app.
Then, you can later use the Firebase console or the Remote Config
backend APIs to override in-app default values for all app users or
for segments of your user base.
Check out the documentation for the flutter_remote_config plugin.

Which Realtime Database instance I need for Firebase Delete User Data extension

I'm trying to install the Firebase Delete User Data extension. I only use Firestore so I don't need Realtime Database but to configure the extension, an instance of the realtime database is required.
I have the realtime database disabled. In order to finish the installation of the extension I have put the name of my firebase project to test.
Question: What instance do I really have to introduce if I don't use the realtime database?
Thanks in advance.
Hmm... that looks like something they should change in the extension, so I recommend filing a report on the [Github repo](https://github.com/firebase/extensions.
For the moment, you'll have to create a Realtime Database instance in the console, and then select it here. You can select completely disabled security rules for the database, to ensure nobody can write data to it from the client-side SDKs.

How to get all the images from firebase storage in flutter?

Is there a way to get all the images(files) from firebase storage. It doesn't have the listall() function in flutter. If there isn't way to do this, can we get images by their metadata? I don't want to get them by their names.
Until proper file listing gets added to the API, you don't really have a way to do this from Flutter. Your best options are to:
Build a backend endpoint that can use one of the server SDKs to list objects from Cloud Storage. Query that endpoint from your app.
Make a record in a database for each file, and query the database instead. Make sure to keep the bucket and database in sync.

How to disable Cloud Firestore?

I'm using Realtime Database in Firebase and by accident I clicked on Cloud Firestore. Since then whenever I want to access Realtime Database it defaults to Cloud Firestore and I have to click and choose the database I'm using, super annoying. Is there a way to disable or delete it?
Is there a way to disable or delete it?
There is no way you can disable either Cloud Firestore or Firebase realtime database from your Firebase console. The simplest solution I can think of, is to save a bookmark in your browser pointing to:
https://console.firebase.google.com/project/firebaseProjectId/database/yourProjectName/data
You can also copy and paste the url that you need and it will point directly to your Firebase realtime database project. In this way you'll skip the initial steps.

How to use Cloud Firestore and Realtime Database in same project

Firebase's documentation has the following paragraph:
Using Cloud Firestore and Realtime Database: You can use both databases within the same Firebase app or project. Both NoSQL databases can store the same types of data and the client libraries work in a similar manner. Keep in mind the differences outlined above if you decide to use both databases in your app.
I can't find any documentation on how to add a Cloud Firestore to an existing project with a Realtime Database, though. I will ultimately upgrade to Cloud Firestore, but would like some time to experiment and learn before I convert the production database.
Does anybody know how to use both databases in the same Firebase project?
When you go to your project in the console and choose the Database product, you should see something like this the first time:
This is a selector that lets you choose to see either Realtime Database or Firestore in your project. You can switch between the two with this selector.
The first time you select Cloud Firestore, it will ask you to configure things. Start in "test mode" to set things up for full read and write without authentication to get started quickly, but of course your should always have rules set up in production.
After you set up Firestore, you should be able to use both client SDKs to access both databases independently.

Resources