Cleanup
This commit is contained in:
parent
367accb814
commit
a118ee7aaa
4 changed files with 8 additions and 15 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- **S3/Object storage support**: Connect to LanceDB on S3, GCS, Azure Blob, or HDFS via `lancedb.uri` and `storage_options` config. Supports S3-compatible stores (MinIO, Tigris) with custom endpoints.
|
- **S3/Object storage support**: Connect to LanceDB on S3, GCS, Azure Blob, or HDFS via `lancedb.uri` and `storage_options` config. Supports S3-compatible stores with custom endpoints.
|
||||||
- **Remote skill generation**: `create-skill` now supports remote databases — omit `--db` and provide `--config-file` to generate skills that connect to object storage at runtime instead of bundling the database.
|
- **Remote skill generation**: `create-skill` now supports remote databases — omit `--db` and provide `--config-file` to generate skills that connect to object storage at runtime instead of bundling the database.
|
||||||
|
|
||||||
## [0.38.0] - 2026-04-07
|
## [0.38.0] - 2026-04-07
|
||||||
|
|
|
||||||
|
|
@ -45,11 +45,10 @@ class HaikuRAGApp: # pragma: no cover
|
||||||
self.before = before
|
self.before = before
|
||||||
self.console = Console()
|
self.console = Console()
|
||||||
|
|
||||||
@property
|
|
||||||
def _is_local(self) -> bool:
|
|
||||||
from haiku.rag.store.engine import ConnectionMode
|
from haiku.rag.store.engine import ConnectionMode
|
||||||
|
|
||||||
return ConnectionMode.from_config(self.config) == ConnectionMode.LOCAL
|
self._is_local = ConnectionMode.from_config(self.config) == ConnectionMode.LOCAL
|
||||||
|
self._display_path = self.db_path if self._is_local else self.config.lancedb.uri
|
||||||
|
|
||||||
async def init(self):
|
async def init(self):
|
||||||
"""Initialize a new database."""
|
"""Initialize a new database."""
|
||||||
|
|
@ -62,9 +61,8 @@ class HaikuRAGApp: # pragma: no cover
|
||||||
# Create the database
|
# Create the database
|
||||||
client = HaikuRAG(db_path=self.db_path, config=self.config, create=True)
|
client = HaikuRAG(db_path=self.db_path, config=self.config, create=True)
|
||||||
client.close()
|
client.close()
|
||||||
display_path = self.config.lancedb.uri if not self._is_local else self.db_path
|
|
||||||
self.console.print(
|
self.console.print(
|
||||||
f"[bold green]Database initialized at {display_path}[/bold green]"
|
f"[bold green]Database initialized at {self._display_path}[/bold green]"
|
||||||
)
|
)
|
||||||
|
|
||||||
async def info(self):
|
async def info(self):
|
||||||
|
|
@ -74,9 +72,8 @@ class HaikuRAGApp: # pragma: no cover
|
||||||
|
|
||||||
# Basic: show path/URI
|
# Basic: show path/URI
|
||||||
self.console.print("[bold]haiku.rag database info[/bold]")
|
self.console.print("[bold]haiku.rag database info[/bold]")
|
||||||
display_path = self.config.lancedb.uri if not self._is_local else self.db_path
|
|
||||||
self.console.print(
|
self.console.print(
|
||||||
f" [repr.attrib_name]path[/repr.attrib_name]: {display_path}"
|
f" [repr.attrib_name]path[/repr.attrib_name]: {self._display_path}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if self._is_local and not self.db_path.exists():
|
if self._is_local and not self.db_path.exists():
|
||||||
|
|
|
||||||
|
|
@ -71,18 +71,16 @@ class InfoModal(ModalScreen):
|
||||||
# Path
|
# Path
|
||||||
lines.append(f"[bold $accent]path[/bold $accent]: {self.db_path}")
|
lines.append(f"[bold $accent]path[/bold $accent]: {self.db_path}")
|
||||||
|
|
||||||
is_local = (
|
is_local = self.client.store._connection_mode == ConnectionMode.LOCAL
|
||||||
ConnectionMode.from_config(self.client.store._config)
|
|
||||||
== ConnectionMode.LOCAL
|
|
||||||
)
|
|
||||||
if is_local and not self.db_path.exists():
|
if is_local and not self.db_path.exists():
|
||||||
lines.append("[red]Database path does not exist.[/red]")
|
lines.append("[red]Database path does not exist.[/red]")
|
||||||
self._content_widget.update("\n".join(lines))
|
self._content_widget.update("\n".join(lines))
|
||||||
return
|
return
|
||||||
|
|
||||||
# Connect to get table info
|
# Connect to get table info
|
||||||
|
config = self.client.store._config
|
||||||
try:
|
try:
|
||||||
db = connect_lancedb(self.client.store._config, self.db_path)
|
db = connect_lancedb(config, self.db_path)
|
||||||
table_names = set(db.list_tables().tables)
|
table_names = set(db.list_tables().tables)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
lines.append(f"[red]Failed to open database: {e}[/red]")
|
lines.append(f"[red]Failed to open database: {e}[/red]")
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,6 @@ from haiku.rag.store.exceptions import MigrationRequiredError, ReadOnlyError
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
OBJECT_STORAGE_PREFIXES = ("s3://", "gs://", "az://", "hdfs://")
|
|
||||||
|
|
||||||
|
|
||||||
class ConnectionMode(Enum):
|
class ConnectionMode(Enum):
|
||||||
LOCAL = "local"
|
LOCAL = "local"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue