Skip to content

Commit

Permalink
Merge pull request #1520 from Jaseci-Labs/minor/localdb-update
Browse files Browse the repository at this point in the history
[LOCAL-DB]: Adjustable local db path
  • Loading branch information
ypkang authored Jan 22, 2025
2 parents 55769eb + 718baef commit 5acb2f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jac-cloud/jac_cloud/jaseci/datasources/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,14 @@ def get_client() -> MongoClient:
)
else:
logger.info("DATABASE_HOST is not available! Using LocalDB...")
path = getenv("DATABASE_PATH") or "mydatabase"
set_storage(
repository="mydatabase",
repository=path,
storage="sqlite",
mongo_version="4.4",
use_bson=True,
)
client = Collection.__client__ = MontyClient("mydatabase")
client = Collection.__client__ = MontyClient(path)

return client

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| HOST | FastAPI's host argument | 0.0.0.0 |
| PORT | FastAPI's port argument | 8000 |
| DATABASE_HOST | MongoDB connection string | mongodb://localhost/?retryWrites=true&w=majority |
| DATABASE_PATH | Local path for DB | mydatabase |
| DATABASE_NAME | MongoDB database name | jaseci |
| REDIS_HOST | Redis connection host | redis://localhost |
| REDIS_PORT | Redis connection port | 6379 |
Expand Down

0 comments on commit 5acb2f6

Please sign in to comment.