sqlsaber 0.24.0__py3-none-any.whl → 0.26.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of sqlsaber might be problematic. Click here for more details.

@@ -23,7 +23,7 @@ class ResolvedDatabase:
23
23
  connection_string: str # Canonical connection string for DatabaseConnection factory
24
24
 
25
25
 
26
- SUPPORTED_SCHEMES = {"postgresql", "mysql", "sqlite", "csv"}
26
+ SUPPORTED_SCHEMES = {"postgresql", "mysql", "sqlite", "duckdb", "csv"}
27
27
 
28
28
 
29
29
  def _is_connection_string(s: str) -> bool:
@@ -67,8 +67,8 @@ def resolve_database(
67
67
  scheme = urlparse(spec).scheme
68
68
  if scheme in {"postgresql", "mysql"}:
69
69
  db_name = urlparse(spec).path.lstrip("/") or "database"
70
- elif scheme in {"sqlite", "csv"}:
71
- db_name = Path(urlparse(spec).path).stem
70
+ elif scheme in {"sqlite", "duckdb", "csv"}:
71
+ db_name = Path(urlparse(spec).path).stem or "database"
72
72
  else: # should not happen because of SUPPORTED_SCHEMES
73
73
  db_name = "database"
74
74
  return ResolvedDatabase(name=db_name, connection_string=spec)
@@ -83,6 +83,10 @@ def resolve_database(
83
83
  if not path.exists():
84
84
  raise DatabaseResolutionError(f"SQLite file '{spec}' not found.")
85
85
  return ResolvedDatabase(name=path.stem, connection_string=f"sqlite:///{path}")
86
+ if path.suffix.lower() in {".duckdb", ".ddb"}:
87
+ if not path.exists():
88
+ raise DatabaseResolutionError(f"DuckDB file '{spec}' not found.")
89
+ return ResolvedDatabase(name=path.stem, connection_string=f"duckdb:///{path}")
86
90
 
87
91
  # 3. Must be a configured name
88
92
  db_cfg: DatabaseConfig | None = config_mgr.get_database(spec)