kitchen-cli icon indicating copy to clipboard operation
kitchen-cli copied to clipboard

Not using Mongo

Open vchigne opened this issue 9 years ago • 13 comments

Hello Perak.. Great concept! We are not using Mongo as database in our meteor apps. Instead, we have created a loopback API to retrieve MySQL data and works great. My question is: What should be modified/hacked to not use suscriptions but RESTFUL API or any other ordinary data access function instead? And, BTW, do you have plans to support the coming SQL databses support in meteor? Regards

vchigne avatar Aug 27 '15 19:08 vchigne

Hey dude, that's interesting (sql + meteor). Meteor kitchen will be open source soon, so it would be possible to "hack it" for your needs, however, it will "officially" support meteors sql.

Anyway, I am cleaning up the code and writing docs, and that will take a while 'cause I'm busy with "real" job. If you think it's small & simple hack to fit kitchen for your needs, please male example and explanation for me and I'l see what I can do.

Cheers! Petar On Aug 27, 2015 21:59, "Victor Chigne" [email protected] wrote:

Hello Perak.. Great concept! We are not using Mongo as database in our meteor apps. Instead, we have created a loopback API to retrieve MySQL data and works great. My question is: What should be modified/hacked to not use suscriptions but RESTFUL API or any other ordinary data access function instead? And, BTW, do you have plans to support the coming SQL databses support in meteor? Regards

— Reply to this email directly or view it on GitHub https://github.com/perak/kitchen-cli/issues/3.

perak avatar Aug 27 '15 20:08 perak

Sure. What we will love to have is a meteor app using an arbitrary datasource. Using a REST API, we can do that, and LoopBack.io shines at that.

So what I really need is a way to hack your subscription object and provide my own function instead of meteor's default.

It would be something like this:

subscription { "name": "Customers", "params": [ ], "dataProvider": myCustomersFunction(res,req),

}

Is this enough detail?

vchigne avatar Aug 27 '15 20:08 vchigne

I'm still looking at the API. It seems that the object to hack is collection instead, but I'm not sure. Let me check a generated app and try to hack it manually. Get back to you ASAP

vchigne avatar Aug 27 '15 20:08 vchigne

OK :)

On Thu, Aug 27, 2015 at 10:39 PM, Victor Chigne [email protected] wrote:

I'm still looking at the API. It seems that the object to hack is collection instead, but I'm not sure. Let me check a generated app and try to hack it manually. Get back to you ASAP

— Reply to this email directly or view it on GitHub https://github.com/perak/kitchen-cli/issues/3#issuecomment-135549539.

perak avatar Aug 27 '15 21:08 perak

In meantime, maybe you can "hack" something in meteor-kitchen's template files, for example:

~/.meteor-kitchen/templates/code/collection_server.js
~/.meteor-kitchen/templates/code/collection_shared.js
~/.meteor-kitchen/templates/code/collection_client.js

"Kitchen" is using these files to generate code related to collection by replacing strings, but it also adds some code...

perak avatar Aug 27 '15 21:08 perak

BTW, how you are inserting, updating, removing data? Do you have some middle layer interface so you can use mongo style MyTable.insert({ ... }), MyTable.update({ ... }, { ... }), MyTable.remove({ ... }) or ... ?

perak avatar Aug 27 '15 21:08 perak

Also, there is alternative way to use kitchen - if it's enough for you to generate pages/routes/user account system/access rights, maybe you can consider not generating code related to database at all - instead you can write that manually and provide source files to kitchen's "copy_files": [ ... ] mechanism. (?)

perak avatar Aug 27 '15 21:08 perak

Yes , that would do it. Also, I can use the meteor collection hooks to do my business in the Rest API. There should be a way to simply not use mongo at all, just process the hooks. I'm inspecting the code.

vchigne avatar Aug 27 '15 21:08 vchigne

I can do the middle layer interface, that's exactly what I need

vchigne avatar Aug 27 '15 21:08 vchigne

It's been a long time. Now meteor is pushing Apollo to access other databases. Are you planning to generate Apollo code?

vchigne avatar May 19 '16 06:05 vchigne

@vchigne sure!

perak avatar May 19 '16 07:05 perak

Looking forward to the open source so we can help contribute!

Sent from BlueMail

On May 19, 2016, 00:31, at 00:31, "Petar Korponaić" [email protected] wrote:

@vchigne sure!


You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/perak/kitchen-cli/issues/3#issuecomment-220248644

johnf76 avatar May 19 '16 07:05 johnf76

That's great! You are building a great LOB app generator.

vchigne avatar May 19 '16 21:05 vchigne