Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utilities for adding indexes #14

Closed
simonw opened this issue Feb 24, 2019 · 3 comments
Closed

Utilities for adding indexes #14

simonw opened this issue Feb 24, 2019 · 3 comments

Comments

@simonw
Copy link
Owner

simonw commented Feb 24, 2019

Both in the Python API and the CLI tool. For the CLI tool this should work:

$ sqlite-utils create-index mydb.db mytable col1 col2

This will create a compound index across col1 and col2. The name of the index will be automatically chosen unless you use the --name=... option.

Support a --unique option too.

@simonw
Copy link
Owner Author

simonw commented Feb 24, 2019

https://www.sqlite.org/lang_createindex.html

image

May as well support --if-not-exists as well.

@simonw
Copy link
Owner Author

simonw commented Feb 24, 2019

The WHERE clause can be used to create partial indexes: https://www.sqlite.org/partialindex.html

I'm going to ignore it for the moment.

@simonw
Copy link
Owner Author

simonw commented Feb 24, 2019

Likewise I'm going to ignore indexes on expressions (as opposed to just columns): https://www.sqlite.org/expridx.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant