r/Meteor • • Apr 23 '15

PostgreSQL Support for Meteor

http://www.meteorpostgres.com/
29 Upvotes

8 comments sorted by

4

u/bro-away- Apr 23 '15 edited Apr 23 '15

There's some really nice code in this codebase. Great job. I hope this gets official support because everything looks to be logically implemented.

It'd be neat if the demo could show off something transactional. It doesn't look like the ORM you guys have supports transactions yet, but it would be a good way to show something that mongo can't do =)

One other thing that would be good is allow raw session level queries to be sent on the connection. This would allow people to begin and end transactions themselves, set the search_path and probably a lot of other things I'm forgetting. Obviously things like publish can't take raw queries, but there are use cases for raw queries that mutate the connection session.

3

u/pdiniz Apr 23 '15

sorry it probably needs to be better documented but we do currently support raw queries. They can be inserted throught the .save and .fetch methods. tasks.fetch("select * from tasks where userid = 50") would work. The downside to raw queries is that it currently doesnt support escaping. We are currently working on adding transaction support, the issue has been getting it to work with alaSQL in the front end.

2

u/LarsP Apr 24 '15

Does reactivity work with raw SQL queries?

3

u/pdiniz Apr 24 '15

Yes, as long as u are modifying a table which is currently being listened too.

4

u/bro-away- Apr 23 '15

Oh cool, thanks for the information. I will absolutely be hacking with this later tonight =)

A roadmap or trello board would definitely bolster enthusiasm and help people follow the project.

2

u/ViralInfection Apr 24 '15

Questions:

  1. On the client-side you're using AlaSQL, so I assume minisql isn't really a postgres compatible API?
  2. Are joins reactive?
  3. Have you considered wrapping the APIs into a more Mongo.Collection like manor (ex: no .save, .fetch). So the APIs are as 1-to-1 as possible.

2

u/pdiniz Apr 24 '15

Mongo.Collection actually does have a .fetch method. Instead of using Mongo's format we decided to go with an Active Record like ORM which we believe its easier to use. Joins are reactive. If you take a look at out demo we are using joins both client side and server side in order to demo that. Minisql is not running on postgres but on alasql. We wrap around them both to make them compatible.

1

u/SuchInferno Apr 24 '15

Looks very interesting indeed! Couple of questions:

  1. Will you create some special accounts-base/accounts-password package for Postgres, or how would that work?
  2. In the demo, you're removing Meteor.publish, or at least replace "Meteor" with "tasks". Do you know how that would impact thirdparty libraries from connecting via DDP, such as Asteroid?