Skip to content

Commit 1fbdd1c

Browse files
committed
allow sqlite connector rather than postgres
1 parent e5448b9 commit 1fbdd1c

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

src/murfey/server/murfey_db.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ def url(security_config: Security | None = None) -> str:
1717
creds = yaml.safe_load(stream)
1818
f = Fernet(security_config.crypto_key.encode("ascii"))
1919
p = f.decrypt(creds["password"].encode("ascii"))
20+
if security_config.db == "sqlite":
21+
return f"sqlite:///{creds['database']}"
2022
return f"postgresql+psycopg2://{creds['username']}:{p.decode()}@{creds['host']}:{creds['port']}/{creds['database']}"
2123

2224

src/murfey/util/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ class Security(BaseModel):
228228
# Murfey database settings
229229
murfey_db_credentials: Path
230230
crypto_key: str
231+
db: str = "postgres"
231232
sqlalchemy_pooling: bool = True
232233

233234
# ISPyB settings

0 commit comments

Comments
 (0)