ropensci / nodbi

Document DBI connector for R
https://docs.ropensci.org/nodbi
Other
76 stars 6 forks source link

Beyond fetching the whole data frame #10

Closed richfitz closed 2 years ago

richfitz commented 9 years ago

It looks like the mongodb driver has support for selecting columns of the data.frame on export; how should we present this generally so that other drivers can support it in a consistent way? Options seem to be: arguments to docdbi_get or have docdbi_select which allows potentially more efficient bulk gets? At the same time we're going to want filtering too, right?

jeroen commented 9 years ago

I guess it depends a bit to what extend other back-ends can also support this. I think docdbi should define mostly generic nosql logic, not too much stuff specific to a particular implementation. Mongo indeed supports query (filter), sort, limit, select, etc.

richfitz commented 9 years ago

So, the way to do this would be to allow different backends to support different sets of operations; we have a set of required operations (currently create/get/delete) but we could allow different drivers to implement or not other features, and can fall back on R-based ones perhaps (so the default methods would get the whole data.frame and slice and dice in R).

But that's all orthogonal to where support would go. I think DBI does many functions rather than many args. That'd be easiest to support.

sckott commented 9 years ago
sckott commented 9 years ago

see also #3

rfhb commented 2 years ago

docdb_query() now accepts parameters query and fields (in MongoDB syntax), which work across databases (CouchDB, Elasticsearch, MongoDB, SQLite, PostgreSQL) to retrieve selected documents and selected fields, as per 219b123fd9fed88d8aea1fda90d5ddc4bcbc098c. See also https://github.com/ropensci/nodbi#walk-through.