File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -671,16 +671,18 @@ def schema(self) -> str:
671671 @property
672672 def supports_strict (self ) -> bool :
673673 "Does this database support STRICT mode?"
674- try :
675- table_name = "t{}" .format (secrets .token_hex (16 ))
676- with self .conn :
677- self .conn .execute (
678- "create table {} (name text) strict" .format (table_name )
679- )
680- self .conn .execute ("drop table {}" .format (table_name ))
681- return True
682- except Exception :
683- return False
674+ if not hasattr (self , "_supports_strict" ):
675+ try :
676+ table_name = "t{}" .format (secrets .token_hex (16 ))
677+ with self .conn :
678+ self .conn .execute (
679+ "create table {} (name text) strict" .format (table_name )
680+ )
681+ self .conn .execute ("drop table {}" .format (table_name ))
682+ self ._supports_strict = True
683+ except Exception :
684+ self ._supports_strict = False
685+ return self ._supports_strict
684686
685687 @property
686688 def sqlite_version (self ) -> Tuple [int , ...]:
You can’t perform that action at this time.
0 commit comments