@@ -64,9 +64,11 @@ def __init__(
6464 self ._setup_connection ()
6565
6666 def _setup_connection (self ) -> None :
67- """Set up the connection for use by core modules."""
68- # Import here to avoid circular imports and to allow
69- # the connection to be set before other modules use it
67+ """Set up the connection for use by core modules.
68+
69+ Note: api.extensions is imported lazily to allow SDK import
70+ without requiring FalkorDB connection at module load time.
71+ """
7072 import api .extensions
7173 api .extensions .db = self ._connection .db
7274
@@ -111,7 +113,6 @@ async def connect_database(self, db_url: str) -> DatabaseConnection:
111113 ValueError: If the database URL format is invalid.
112114 """
113115 from api .core .schema_loader import load_database_sync
114-
115116 return await load_database_sync (db_url , self ._user_id )
116117
117118 async def query (
@@ -173,7 +174,6 @@ async def get_schema(self, database: str) -> SchemaResult:
173174 ValueError: If the database is not found.
174175 """
175176 from api .core .text2sql import get_schema as _get_schema
176-
177177 schema = await _get_schema (self ._user_id , database )
178178 return SchemaResult (
179179 nodes = schema .get ("nodes" , []),
@@ -187,7 +187,6 @@ async def list_databases(self) -> list[str]:
187187 List of database identifiers.
188188 """
189189 from api .core .schema_loader import list_databases as _list_databases
190-
191190 return await _list_databases (self ._user_id , self ._general_prefix )
192191
193192 async def delete_database (self , database : str ) -> bool :
@@ -206,7 +205,6 @@ async def delete_database(self, database: str) -> bool:
206205 ValueError: If the database is not found or cannot be deleted.
207206 """
208207 from api .core .text2sql import delete_database as _delete_database
209-
210208 result = await _delete_database (self ._user_id , database )
211209 return result .get ("success" , False )
212210
@@ -226,7 +224,6 @@ async def refresh_schema(self, database: str) -> RefreshResult:
226224 ValueError: If the database is not found.
227225 """
228226 from api .core .text2sql import refresh_database_schema_sync
229-
230227 return await refresh_database_schema_sync (self ._user_id , database )
231228
232229 async def execute_confirmed (
0 commit comments