berlindb / core

All of the required core code
MIT License
253 stars 27 forks source link

Issue/37 - Introduce an Index class #43

Closed JJJ closed 4 years ago

JJJ commented 4 years ago

This work-in-progress includes a new Index class and a few helper methods to make querying for and comparing indexes possible - and ideally, easy.

See #37

JJJ commented 4 years ago

For #37.

JJJ commented 4 years ago

I spent some time working on this today, and decided I don't like this direction... yet, anyways.

The problem, is that things like Tables, Columns, Rows, and Queries are objects but here an Index is just a class full of operations.

Indexes could be (maybe should be) objects. Much like other objects, Indexes can be added, edited, dropped, and so on - and the more methods I added to this class, the more I found myself wanting Indexes to be registered ahead of time just like everything else is, and to then be able to perform operations from those classes.

So, I'm going to close this PR and go the originally intended route of adding a method instead. It's simpler, and addresses the original concern. If we want to, we can always pick this back up later.