Check if configured backend is KuzuDB.
()
| 25 | |
| 26 | |
| 27 | def _is_kuzu_available() -> bool: |
| 28 | """Check if configured backend is KuzuDB.""" |
| 29 | try: |
| 30 | import kuzu # noqa: F401 |
| 31 | except ImportError: |
| 32 | return False |
| 33 | |
| 34 | try: |
| 35 | from codegraphcontext.cli.config_manager import get_config_value |
| 36 | |
| 37 | configured_backend = get_config_value("DEFAULT_DATABASE") |
| 38 | |
| 39 | # Only run tests if configured backend is kuzudb |
| 40 | if configured_backend != "kuzudb": |
| 41 | return False |
| 42 | |
| 43 | # Verify KuzuDB can actually connect |
| 44 | from codegraphcontext.core.database_kuzu import KuzuDBManager |
| 45 | |
| 46 | db = KuzuDBManager() |
| 47 | if db.get_driver() is not None: |
| 48 | return True |
| 49 | return False |
| 50 | except Exception: |
| 51 | return False |
| 52 | |
| 53 | |
| 54 | def _get_kuzu_db(): |
no test coverage detected