numtel / meteor-mysql

Reactive MySQL for Meteor
MIT License
343 stars 41 forks source link

Can MysqlSubscription be implemented in client only? #29

Closed HosseinAgha closed 9 years ago

HosseinAgha commented 9 years ago

I wanted to thank you for your package, it saved me a lot of mysql to mongo migration headache! I put MysqlSubscription in client code only and your mysql leaderboards example still works perfectly. Why should we implement it in server?

numtel commented 9 years ago

I do not understand what you are asking. If you want to have a collection of results without being connected to a database, why not use an array?

HosseinAgha commented 9 years ago

Sorry I think i couldn't explain what I mean. Can you explain why we need to call MysqlSubscription both on client and server (based on your readme)? Because meteor doc says we must call Meteor.subscribe on client only. Aren't they basically the same?

numtel commented 9 years ago

You do not have to create the subscription on both the client and server. The interface works on both though in case you want to.

If you're writing live queries that live only on the server though, you're better off just listening to the events from mysql-live-select.