devinivy / dogwater

A hapi plugin integrating Waterline ORM
MIT License
102 stars 14 forks source link

Dogwater plugins #27

Closed devinivy closed 7 years ago

devinivy commented 9 years ago

I want to put forth the idea of a very simple plugin-like structure for dogwater. There are cases in which one may want to modularize different areas of their model/configurations, and I would like dogwater to cater to that.

I would also like plugins to be able to consume non-standard Waterline model and attribute properties in a safe way so that dogwater plugins may extend the functionality of Waterline as it lives in the hapi ecosystem.

I'm taking suggestions here as to how to implement this, and spec out a working first-draft API. I'd like to see this as the main feature of 1.2.0 or 2.0.0.

chacliff commented 9 years ago

I saw the issue that you posted to the hapi-waterline thread. I had originally considered dogwater for my applications but it seemed that it was easier to seperate models to their own directory and individual files with their plugin. I might suggest improving your docs, but you seem to be more active in improving your plugins and i would be happy to help contribute if i can.

devinivy commented 9 years ago

@chacliff thanks for that! I would like for the docs to be very precise and useful. Waterline is a complicated tool, however, and I do not intend to duplicate documentation for using Waterline here. If you have any particular ideas for modularizing models, please let me know here!

When I use dogwater I usually have a models folder with an index.js file like this in it: https://github.com/semateos/stimpy-medium/tree/master/server/models . That allows me to break my model definitions up into several files. But it does not let me break my model up across multiple plugins, which is what I would like to achieve.

atiertant commented 8 years ago

@devinivy hi, i would love integrate offshore in hapi, do you think it would be possible using dogwater plugins ?

devinivy commented 8 years ago

@atiertant I didn't have that in mind for dogwater plugins. If you'd like to add a feature to dogwater to pass an existing waterline-like instance (to be used here), I would be open to that. Do you think that would allow you to use offshore with hapi?

atiertant commented 8 years ago

well i would like a full integration solution, wouldn't like users have to do it themselves... it would be great if they only have to: npm install dogwater-offshore and then could access it in server.offshore couldn't plugin you had in mind hook orm instance, initialize options(here) and export name ?

devinivy commented 8 years ago

That does sound possible, yes. As things currently stand, I suggest we allow the ORM instance to be passed to dogwater. Then dogwater-offshore could simply wrap dogwater and pass it an offshore instance. Some day when the dogwater plugin is completed, dogwater-offshore could be turned into a dogwater plugin.

My first priority right now is for dogwater to allow model definitions to be split up across several hapi plugins (#37). Only once that is completed will I work on dogwater plugins.

atiertant commented 8 years ago

@devinivy i'm waiting this moment. ;)