From f2f97ce6e92c7714f5f742fe7cdad5eba2739569 Mon Sep 17 00:00:00 2001 From: Alexandre Maillot Date: Mon, 27 Jan 2025 11:50:21 +0400 Subject: [PATCH 1/3] ajoute cloud prefix database --- lib/firestore/firestore_gateway.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/firestore/firestore_gateway.dart b/lib/firestore/firestore_gateway.dart index 7fd6404..2ee9bb5 100644 --- a/lib/firestore/firestore_gateway.dart +++ b/lib/firestore/firestore_gateway.dart @@ -114,7 +114,11 @@ class FirestoreGateway { } Future deleteDocument(String path) => _client - .deleteDocument(DeleteDocumentRequest()..name = path) + .deleteDocument( + DeleteDocumentRequest()..name = path, + options: + CallOptions(metadata: {'google-cloud-resource-prefix': database}), + ) .catchError(_handleError); Stream streamDocument(String path) { From 91130523396df30157438aa6a454717706a3085f Mon Sep 17 00:00:00 2001 From: Alexandre Maillot Date: Mon, 27 Jan 2025 12:02:09 +0400 Subject: [PATCH 2/3] add cloud prefix database --- lib/firestore/firestore_gateway.dart | 30 ++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/lib/firestore/firestore_gateway.dart b/lib/firestore/firestore_gateway.dart index 2ee9bb5..3c653a9 100644 --- a/lib/firestore/firestore_gateway.dart +++ b/lib/firestore/firestore_gateway.dart @@ -41,8 +41,13 @@ class FirestoreGateway { ..collectionId = path.substring(path.lastIndexOf('/') + 1) ..pageSize = pageSize ..pageToken = nextPageToken; - var response = - await _client.listDocuments(request).catchError(_handleError); + var response = await _client + .listDocuments( + request, + options: + CallOptions(metadata: {'google-cloud-resource-prefix': database}), + ) + .catchError(_handleError); var documents = response.documents.map((rawDocument) => Document(this, rawDocument)); return Page(documents, response.nextPageToken); @@ -86,14 +91,21 @@ class FirestoreGateway { ..documentId = documentId ?? '' ..document = document; - var response = - await _client.createDocument(request).catchError(_handleError); + var response = await _client + .createDocument( + request, + options: + CallOptions(metadata: {'google-cloud-resource-prefix': database}), + ) + .catchError(_handleError); return Document(this, response); } Future getDocument(path) async { var rawDocument = await _client - .getDocument(GetDocumentRequest()..name = path) + .getDocument(GetDocumentRequest()..name = path, + options: CallOptions( + metadata: {'google-cloud-resource-prefix': database})) .catchError(_handleError); return Document(this, rawDocument); } @@ -110,7 +122,13 @@ class FirestoreGateway { request.updateMask = mask; } - await _client.updateDocument(request).catchError(_handleError); + await _client + .updateDocument( + request, + options: + CallOptions(metadata: {'google-cloud-resource-prefix': database}), + ) + .catchError(_handleError); } Future deleteDocument(String path) => _client From 281ed9265d11d04d6a60545fbd3f8903400d55f0 Mon Sep 17 00:00:00 2001 From: Alexandre Maillot Date: Mon, 27 Jan 2025 12:02:27 +0400 Subject: [PATCH 3/3] add cloud prefix database --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index a991524..4c07ba0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: firedart description: A dart-native implementation of the Firebase Auth and Firestore SDKs. -version: 0.9.8 +version: 0.9.9 homepage: https://github.com/cachapa/firedart environment: