Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions python/cocoindex/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ def from_env(cls) -> Self:

database_url = os.getenv("COCOINDEX_DATABASE_URL")
if database_url is not None:
db_kwargs: dict[str, Any] = dict()
_load_field(db_kwargs, "url", "COCOINDEX_DATABASE_URL", required=True)
db_kwargs: dict[str, Any] = {"url": database_url}
_load_field(db_kwargs, "user", "COCOINDEX_DATABASE_USER")
_load_field(db_kwargs, "password", "COCOINDEX_DATABASE_PASSWORD")
_load_field(
Expand Down
2 changes: 1 addition & 1 deletion src/lib_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ impl LibContext {
pub fn require_persistence_ctx(&self) -> Result<&PersistenceContext> {
self.persistence_ctx
.as_ref()
.ok_or_else(|| anyhow!("Database is required for this operation. Please set COCOINDEX_DATABASE_URL environment variable and call cocoindex.init() with database settings."))
.ok_or_else(|| anyhow!("Database is required for this operation. Please set COCOINDEX_DATABASE_URL environment variable OR call `cocoindex.init()` with database settings."))
}

pub fn require_builtin_db_pool(&self) -> Result<&PgPool> {
Expand Down
Loading