diff --git a/src/ndi/database.py b/src/ndi/database.py index 4d8cb9b..c529d0b 100644 --- a/src/ndi/database.py +++ b/src/ndi/database.py @@ -216,17 +216,18 @@ def __init__(self, session_path: str | Path, db_name: str = ".ndi", **backend_kw db_dir.mkdir(parents=True, exist_ok=True) # Initialize SQLite driver (wraps DID-python's SQLiteDB) - db_path = db_dir / "ndi.db" + db_path = db_dir / "did-sqlite.sqlite" self._driver = SQLiteDriver(db_path, **backend_kwargs) - # Binary directory for file attachments - self._binary_dir = self.session_path / db_name / "binary" + # Binary/files directory for file attachments + # Named "files" for compatibility with NDI-MATLAB + self._binary_dir = self.session_path / db_name / "files" self._binary_dir.mkdir(parents=True, exist_ok=True) @property def database_path(self) -> Path: """Path to the SQLite database file.""" - return self.session_path / self._db_name / "ndi.db" + return self.session_path / self._db_name / "did-sqlite.sqlite" @property def binary_path(self) -> Path: diff --git a/tests/test_database.py b/tests/test_database.py index 81b7ff1..4df9c68 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -64,7 +64,7 @@ def test_create_database(self, temp_session): db = Database(temp_session) assert db.session_path == temp_session assert (temp_session / ".ndi").exists() - assert (temp_session / ".ndi" / "ndi.db").exists() + assert (temp_session / ".ndi" / "did-sqlite.sqlite").exists() def test_create_with_custom_db_name(self, temp_session): """Test creating database with custom name.""" @@ -395,7 +395,7 @@ def test_database_path(self, temp_session): """Test database_path property points to SQLite file.""" db = Database(temp_session) assert db.database_path.exists() - assert str(db.database_path).endswith("ndi.db") + assert str(db.database_path).endswith("did-sqlite.sqlite") def test_binary_path(self, temp_session): """Test binary_path property."""