simonw / sqlite-utils

Python CLI utility and library for manipulating SQLite databases
https://sqlite-utils.datasette.io
Apache License 2.0
1.58k stars 106 forks source link

Allow an index to be dropped #626

Open tobych opened 2 months ago

tobych commented 2 months ago

Hi. This library is awesome! Also. I'd love to be able to drop an index.

I can submit a PR to do this, but I'd love some discussion first.

Unless, of course, there's a way of doing this from the library I've not noticed.

Something like this:

mytable.indexes[0].drop(ignore=True)

I guess ideally I could access the index by name, too. Separate issue, of course.

mytable.indexes['idx_table_col1_col2'].drop(ignore=True)