Remove View.enable_fts()

The method existed only to raise NotImplementedError, since
full-text search is not supported for views, and it showed up in
the generated API reference as a documented View method. Calling
enable_fts() on a View now raises AttributeError like any other
missing method. The sqlite-utils enable-fts command uses db.table()
and shows a clean error when pointed at a view instead of a
traceback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UnLnhsH25Nnv7LHhekUfPd
This commit is contained in:
Claude 2026-07-04 20:44:04 +00:00
commit adea475a61
No known key found for this signature in database
5 changed files with 23 additions and 12 deletions

View file

@ -702,14 +702,14 @@ def enable_fts(
_register_db_for_cleanup(db)
_load_extensions(db, load_extension)
try:
db[table].enable_fts(
db.table(table).enable_fts(
column,
fts_version=fts_version,
tokenize=tokenize,
create_triggers=create_triggers,
replace=replace,
)
except OperationalError as ex:
except (NoTable, OperationalError) as ex:
raise click.ClickException(str(ex))

View file

@ -4317,12 +4317,6 @@ class View(Queryable):
if not ignore:
raise
def enable_fts(self, *args: object, **kwargs: object) -> None:
"``enable_fts()`` is supported on tables but not on views."
raise NotImplementedError(
"enable_fts() is supported on tables but not on views"
)
def jsonify_if_needed(value: object) -> object:
if isinstance(value, decimal.Decimal):