File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -2162,6 +2162,11 @@ def __repr__(self):
21622162 def drop (self ):
21632163 self .db .execute ("DROP VIEW [{}]" .format (self .name ))
21642164
2165+ def enable_fts (self , * args , ** kwargs ):
2166+ raise NotImplementedError (
2167+ "enable_fts() is supported on tables but not on views"
2168+ )
2169+
21652170
21662171def chunks (sequence , size ):
21672172 iterator = iter (sequence )
Original file line number Diff line number Diff line change @@ -369,6 +369,14 @@ def test_enable_fts_replace_does_nothing_if_args_the_same():
369369 assert all (q [0 ].startswith ("select " ) for q in queries )
370370
371371
372+ def test_enable_fts_error_message_on_views ():
373+ db = Database (memory = True )
374+ db .create_view ("hello" , "select 1 + 1" )
375+ with pytest .raises (NotImplementedError ) as e :
376+ db ["hello" ].enable_fts ()
377+ assert e .value .args [0 ] == "enable_fts() is supported on tables but not on views"
378+
379+
372380@pytest .mark .parametrize (
373381 "kwargs,fts,expected" ,
374382 [
You can’t perform that action at this time.
0 commit comments