nobbyknox / hal

Home automation system
Apache License 2.0
0 stars 0 forks source link

Need to be able to easily select enabled lights and scenes #13

Closed nobbyknox closed 8 years ago

nobbyknox commented 8 years ago

The time has come for the big guns. We need to sort out our database query strategy. Will we build Knex.js queries directly or will we abstract them?

nobbyknox commented 8 years ago

My current thoughts.

Building an abstraction layer is a big job. This is a small project which begs the question: do we need an abstraction? It feels like overkill.

We don't need to have that fuzzy feeling inside to know that we can replace the data repository and that the abstraction layer will protect the client code from the effect of this. Once again, this is overkill.

What is not overkill is simple, flexible, and direct queries against the database. We've all been doing it for years. Why not here as well?

nobbyknox commented 8 years ago

Implemented the simple method. Works like a charm. :smiley: