Skip to content

Commit 18f4111

Browse files
committed
Merge branch 'master' of https://github.com/octabytes/FireO
2 parents d58fd5f + e39af8c commit 18f4111

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/fireo/database/database.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from fireo.database.errors import DBConnectionError
22
from google.cloud import firestore
33

4-
54
class Database:
65
"""Create connection with google cloud firestore
76
@@ -34,12 +33,14 @@ class Database:
3433
def __init__(self):
3534
self._conn = None
3635

37-
def connect(self,credentials=None, from_file=None):
36+
def connect(self,credentials=None, from_file=None, client=None):
3837
try:
3938
if credentials:
4039
self._conn = firestore.Client(credentials=credentials)
4140
elif from_file:
4241
self._conn = firestore.Client.from_service_account_json(from_file)
42+
elif client:
43+
self._conn = client
4344
else:
4445
raise DBConnectionError("Credentials or service account json file required to connect with firestore")
4546
except Exception as e:

0 commit comments

Comments
 (0)