-
EAP – Firestore Different Collection
EAP – Firestore Collections
-
EAP – GCP Firestore Storage
EAP – GCP Firestore Storage Example: Import Firestore: from google.cloud import firestore Create Firestore Class: class FirestoreAdapter(DatabaseAdapter): """Firestore database adapter implementation.""" COLLECTION_INTEGRATIONS = "integrations" COLLECTION_JOBS = "jobs" COLLECTION_FILE_ITEMS = "file_items" COLLECTION_ERRORS = "errors" COLLECTION_TENANTS = "tenants" def __init__(self): """Initialize Firestore client.""" self.db: Optional[firestore.AsyncClient] = None self.project_id = settings.gcp_project_id self.database_id = settings.FIRESTORE_DATABASE_ID Establish Firestore Connection: async def connect(self) -> None: """Establish Firestore connection.""" try: self.db = firestore.AsyncClient( project=self.project_id, database=self.database_id, credentials=get_gcp_credentials(), ) logger.info(f"Connected to Firestore: {self.project_id}/{self.database_id}") except Exception as e: # Log only the exception type — the message may contain GCP project # details or auth tokens that should not appear
