2727 SQLiteCloudAccount ,
2828 SQLiteCloudConfig ,
2929 SQLiteCloudConnect ,
30- SQLiteCloudError ,
31- SQLiteCloudException ,
32- SQLiteCloudWarning ,
3330 SQLiteDataTypes ,
3431)
3532from sqlitecloud .driver import Driver
33+ from sqlitecloud .exceptions import (
34+ SQLiteCloudDatabaseError ,
35+ SQLiteCloudDataError ,
36+ SQLiteCloudError ,
37+ SQLiteCloudIntegrityError ,
38+ SQLiteCloudInterfaceError ,
39+ SQLiteCloudInternalError ,
40+ SQLiteCloudNotSupportedError ,
41+ SQLiteCloudOperationalError ,
42+ SQLiteCloudProgrammingError ,
43+ SQLiteCloudWarning ,
44+ )
3645from sqlitecloud .resultset import (
3746 SQLITECLOUD_RESULT_TYPE ,
3847 SQLITECLOUD_VALUE_TYPE ,
5463
5564Warning = SQLiteCloudWarning
5665Error = SQLiteCloudError
57- InterfaceError = SQLiteCloudException
58- DatabaseError = SQLiteCloudException
59- DataError = SQLiteCloudException
60- OperationalError = SQLiteCloudException
61- IntegrityError = SQLiteCloudException
62- InternalError = SQLiteCloudException
63- ProgrammingError = SQLiteCloudException
64- NotSupportedError = SQLiteCloudException
66+ InterfaceError = SQLiteCloudInterfaceError
67+ DatabaseError = SQLiteCloudDatabaseError
68+ DataError = SQLiteCloudDataError
69+ OperationalError = SQLiteCloudOperationalError
70+ IntegrityError = SQLiteCloudIntegrityError
71+ InternalError = SQLiteCloudInternalError
72+ ProgrammingError = SQLiteCloudProgrammingError
73+ NotSupportedError = SQLiteCloudNotSupportedError
6574
6675# Map for types for SQLite
6776STRING = "TEXT"
@@ -254,9 +263,8 @@ def autocommit(self) -> bool:
254263
255264 @autocommit .setter
256265 def autocommit (self , value : bool ) -> None :
257- # TODO: raise NotSupportedError
258266 if not value :
259- raise SQLiteCloudException ("Disable Autocommit is not supported." )
267+ raise SQLiteCloudNotSupportedError ("Disable Autocommit is not supported." )
260268
261269 def execute (
262270 self ,
@@ -300,48 +308,37 @@ def executemany(
300308 return cursor .executemany (sql , seq_of_parameters )
301309
302310 def executescript (self , sql_script : str ):
303- # TODO: raise NotSupportedError
304- raise SQLiteCloudException ("executescript() is not supported." )
311+ raise SQLiteCloudNotSupportedError ("executescript() is not supported." )
305312
306313 def create_function (self , name , num_params , func ):
307- # TODO: raise NotSupportedError
308- raise SQLiteCloudException ("create_function() is not supported." )
314+ raise SQLiteCloudNotSupportedError ("create_function() is not supported." )
309315
310316 def create_aggregate (self , name , num_params , aggregate_class ):
311- # TODO: raise NotSupportedError
312- raise SQLiteCloudException ("create_aggregate() is not supported." )
317+ raise SQLiteCloudNotSupportedError ("create_aggregate() is not supported." )
313318
314319 def create_collation (self , name , func ):
315- # TODO: raise NotSupportedError
316- raise SQLiteCloudException ("create_collation() is not supported." )
320+ raise SQLiteCloudNotSupportedError ("create_collation() is not supported." )
317321
318322 def interrupt (self ):
319- # TODO: raise NotSupportedError
320- raise SQLiteCloudException ("interrupt() is not supported." )
323+ raise SQLiteCloudNotSupportedError ("interrupt() is not supported." )
321324
322325 def set_authorizer (self , authorizer ):
323- # TODO: raise NotSupportedError
324- raise SQLiteCloudException ("set_authorizer() is not supported." )
326+ raise SQLiteCloudNotSupportedError ("set_authorizer() is not supported." )
325327
326328 def set_progress_handler (self , handler , n ):
327- # TODO: raise NotSupportedError
328- raise SQLiteCloudException ("set_progress_handler() is not supported." )
329+ raise SQLiteCloudNotSupportedError ("set_progress_handler() is not supported." )
329330
330331 def set_trace_callback (self , trace_callback ):
331- # TODO: raise NotSupportedError
332- raise SQLiteCloudException ("set_trace_callback() is not supported." )
332+ raise SQLiteCloudNotSupportedError ("set_trace_callback() is not supported." )
333333
334334 def enable_load_extension (self , enable ):
335- # TODO: raise NotSupportedError
336- raise SQLiteCloudException ("enable_load_extension() is not supported." )
335+ raise SQLiteCloudNotSupportedError ("enable_load_extension() is not supported." )
337336
338337 def load_extension (path ):
339- # TODO: raise NotSupportedError
340- raise SQLiteCloudException ("load_extension() is not supported." )
338+ raise SQLiteCloudNotSupportedError ("load_extension() is not supported." )
341339
342340 def iterdump (self ):
343- # TODO: raise NotSupportedError
344- raise SQLiteCloudException ("iterdump() is not supported." )
341+ raise SQLiteCloudNotSupportedError ("iterdump() is not supported." )
345342
346343 def close (self ):
347344 """
@@ -360,7 +357,7 @@ def commit(self):
360357 """
361358 try :
362359 self ._driver .execute ("COMMIT;" , self .sqlitecloud_connection )
363- except SQLiteCloudException as e :
360+ except SQLiteCloudOperationalError as e :
364361 if (
365362 e .errcode == 1
366363 and e .xerrcode == 1
@@ -380,7 +377,7 @@ def rollback(self):
380377 """
381378 try :
382379 self ._driver .execute ("ROLLBACK;" , self .sqlitecloud_connection )
383- except SQLiteCloudException as e :
380+ except SQLiteCloudOperationalError as e :
384381 if (
385382 e .errcode == 1
386383 and e .xerrcode == 1
@@ -696,20 +693,16 @@ def fetchall(self) -> List[Any]:
696693 return self .fetchmany (self .rowcount )
697694
698695 def setinputsizes (self , sizes ) -> None :
699- # TODO: raise NotSupportedError
700- raise SQLiteCloudException ("setinputsizes() is not supported." )
696+ raise SQLiteCloudNotSupportedError ("setinputsizes() is not supported." )
701697
702698 def setoutputsize (self , size , column = None ) -> None :
703- # TODO: raise NotSupportedError
704- raise SQLiteCloudException ("setoutputsize() is not supported." )
699+ raise SQLiteCloudNotSupportedError ("setoutputsize() is not supported." )
705700
706701 def scroll (value , mode = "relative" ):
707- # TODO: raise NotSupportedError
708- raise SQLiteCloudException ("scroll() is not supported." )
702+ raise SQLiteCloudNotSupportedError ("scroll() is not supported." )
709703
710704 def messages (self ):
711- # TODO: raise NotSupportedError
712- raise SQLiteCloudException ("messages() is not supported." )
705+ raise SQLiteCloudNotSupportedError ("messages() is not supported." )
713706
714707 def _call_row_factory (self , row : Tuple ) -> object :
715708 if self .row_factory is None :
@@ -737,7 +730,7 @@ def _ensure_connection(self):
737730 SQLiteCloudException: If the cursor is closed.
738731 """
739732 if not self ._connection :
740- raise SQLiteCloudException ("The cursor is closed." )
733+ raise SQLiteCloudOperationalError ("The cursor is closed." )
741734
742735 def _adapt_parameters (self , parameters : Union [Dict , Tuple ]) -> Union [Dict , Tuple ]:
743736 if isinstance (parameters , dict ):
0 commit comments