Support for create/drop table index #7
+596
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds support for creating/dropping table indexes. Closes #5. Closes #6.
This depends on #2 because it builds on the functionality of warnings. As part of the integration tests, we are now verifying we are getting warnings when we filter on non-indexed columns, then creating an index and verifying warnings go away. So, before reading this diff probably best to merge that PR.
Creating an index
Dropping an index
Unit test coverage
To make sure our structs are marshalling into proper JSON, we added tests that construct commands, marshal them into JSON, and match them to the examples in the docs. Here's an example:
Future enhancements
Probably should do a better job in the godoc of documenting that you want your index names to be unique in the DB not unique per table. Most Postgres devs would probably be familiar with this, but, we shouldn't assume familiarity.