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

Refactor stage2 & stage3 query forge - Collaborate with json-forge project #4636

Open
mdconaway opened this issue Mar 15, 2018 · 2 comments
Open
Labels
3rd party package orm Related to models, datastores, orm config, Waterline, sails-hook-orm, etc. proposal what do you think? Community feedback requested

Comments

@mdconaway
Copy link

Waterline version:0.13.1
Node version:6.2.0
NPM version:5.5.1
Operating system:Ubuntu 16.x


Hey guys,

This is more of a suggestion than a concrete issue!

Recently, my team and I have been streamlining a lot of our clients, policies and other internal services that we develop for our growing colony of sails based servers. As one of our efforts to make our ecosystem more DRY, we developed a common JavaScript module called "json-forge" that we now use heavily in our Ember applications, and in our policy and service modules within our sails servers.

Among other things, this new json-forge now allows us to transmit complex data types from clients to servers in a reliable manner. (Anything from mongo Id's to date objects)

I just open-sourced the simple library here: https://github.com/mdconaway/json-forge

Previously I have dug through some of the query-forge code in waterline and I know it is performing some operations that might be more intuitively handled through a forge instance created using this new library.

Currently json-forge is lacking some features that would be needed to fully reduce the stage2 and stage3 query forges, but I think anything needed by waterline can be added to the json-forge library to enable the recursive forge operations to be configured in flat maps instead of large recursion functions and switch statements.

I would love to enhance the capabilities of json-forge to meet the all waterline query forge requirements, but will need input from the waterline team to make sure the features are fitting with all of the low-level concerns of waterline itself.

One thing that I know will be necessary will be expanding "types" in the case of [] => $in: [], and { a: b, c: d } => $and: [ { a: b }, { c: d } ] , but I do have some fuzzy ideas on how to accomplish this in a configurable manner.

Additionally, I envision sails/waterline being capable of generating many json-forge instances to create unique compressors and maps for each model represented in a project.

Let me know what you think! I would love to collaborate on this.

-Mike

@sailsbot
Copy link

@mdconaway Thanks for posting, we'll take a look as soon as possible.


For help with questions about Sails, click here. If you’re interested in hiring @sailsbot and her minions in Austin, click here.

@johnabrams7 johnabrams7 transferred this issue from balderdashy/waterline Mar 6, 2019
@johnabrams7 johnabrams7 added orm Related to models, datastores, orm config, Waterline, sails-hook-orm, etc. question and removed needs cleanup labels Mar 6, 2019
@balderdashy balderdashy deleted a comment from sailsbot Mar 6, 2019
@johnabrams7
Copy link
Contributor

Hey @mdconaway, we've moved this proposal from Waterline to Sails (balderdashy/sails) to keep a closer eye on updates and boost exposure. I appreciate the time and effort put into this case and welcome any further updates from the community.

@johnabrams7 johnabrams7 added the what do you think? Community feedback requested label Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party package orm Related to models, datastores, orm config, Waterline, sails-hook-orm, etc. proposal what do you think? Community feedback requested
Development

No branches or pull requests

4 participants