meteor / postgres-packages

Early preview of PostgreSQL support for Meteor (deprecated, here for historical reasons)
http://meteor-postgres.readthedocs.org/
158 stars 25 forks source link

.fetchOne() and .fetchValue() support #9

Closed rclai closed 8 years ago

rclai commented 8 years ago

.fetchOne() is similar to Mongo's .findOne(). This would help to nicely wrap .fetch()[0] calls.

.fetchValue() would be used for one-off values like COUNT queries, or to just fetch the value of a single field in a row, which would help to safely wrap calls that do .fetch()[0].field. For example, Todos.select('title').where({ id: 1 }).fetchValue().

stubailo commented 8 years ago

Hmm, sounds like a good idea! If we add a lot of stuff like this we probably need a real API doc for the query stuff. Right now the docs kind of punt it and say "look at the Knex docs".

robfallows commented 8 years ago

So, is the help wanted for the functionality or the API doc?

stubailo commented 8 years ago

Probably both! But the functionality is a much easier place to start :)

robfallows commented 8 years ago

Can this issue be closed now?