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

Add support for pg-promise #162

Open
nitetrik opened this issue Feb 1, 2016 · 8 comments
Open

Add support for pg-promise #162

nitetrik opened this issue Feb 1, 2016 · 8 comments
Labels

Comments

@nitetrik
Copy link

nitetrik commented Feb 1, 2016

Is it possible to replace the Node Postgres with PG-Promise?

@petecoop
Copy link
Owner

petecoop commented Feb 1, 2016

currently Postgres support is using Sequelize, but I'm open to adding other methods e.g Bookshelf #151.

I think as long as there is a default/preferred option highlighted so it doesn't cause information overload for people just wanting to get something up and running without having to research all the choices

@nitetrik
Copy link
Author

nitetrik commented Feb 1, 2016

Sounds good!

@vitaly-t
Copy link

vitaly-t commented Feb 3, 2016

@petecoop if you decide to do that, I will help you (I'm the author of pg-promise) ;)

@petecoop
Copy link
Owner

petecoop commented Feb 4, 2016

I think the main difference is that at the moment I'm using ORM's for the models/DB integration. pg-promise looks like something you would run raw queries with, and use to build an ORM on top.

Of course I'm happy to find a way to build some templates that use raw queries rather than an ORM if people want that, so maybe the options that are presented once selecting Postgres are something like:

Which database library would you like to use?
- Sequelize (ORM)
- Bookshelf (ORM)
- pg-promise (Raw queries)

What do you think @nitetrik ?

@nitetrik
Copy link
Author

nitetrik commented Feb 4, 2016

@petecoop I think that would be great, as i use raw queries for some things. Its good to have choices.

@petecoop
Copy link
Owner

petecoop commented Feb 4, 2016

What do you use for the "M" in MVC @nitetrik ? Do you create a plain javascript object and put queries in there? or not bother with it at all?

@vitaly-t
Copy link

vitaly-t commented Feb 4, 2016

If you guys need an idea of what an app template with pg-promise might look like, have a look at pg-promise-demo.

pg-promise looks like something you would run raw queries with, and use to build an ORM on top.

@petecoop at the very core, yes, you are right. But it also features the best query formatting you can find in a library that's ultimately customizable. Custom Type Formatting, for example, allows developers extend formatting any way they like. And event extend allows extending the protocol with your own repositories - see the demo.

Anyway, the point being, you wouldn't want to use pg-promise to implement an ORM on top of it, there is really no need, it is very self-sufficient. Not to mention it has the best support for transactions you can find, and that's a very high-level stuff, not just raw query formatting. See Tasks and Transactions.

@nitetrik
Copy link
Author

nitetrik commented Feb 8, 2016

I think having choice on whether you want to use ORM like Sequelize, Bookshelf, Waterline, Caminte JS, etc or RAW queries. Cause for certain things raw queries are what all you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants