simonw / db-to-sqlite

CLI tool for exporting tables or queries from any SQL database to a SQLite file
Apache License 2.0
368 stars 28 forks source link

Option to add indexes to all foreign key columns #12

Closed simonw closed 5 years ago

simonw commented 5 years ago

Useful for creating databases that are ready to be used with Datasette - because the Datasette "row" page attempts to show all backwards-links to the current item, which runs really slowly in the absence of indexes on those columns.

This depends on https://github.com/simonw/sqlite-utils/issues/33

simonw commented 5 years ago

I'm going to have this on by default. You can turn it off with a command-line option.

@click.option('--index-foreign-keys/--no-index-foreign-keys`, default=True)
simonw commented 5 years ago

Might use --index-fks to save on typing and hep text space.