20 ms·
Here's something that could be relatively easy (there may be a good library out there already, I haven't looked to hard for it though). Create a node.js module
by derekp7 8y ago
Here's something that could be relatively easy (there may be a good library out there already, I haven't looked to hard for it though). Create a node.js module that takes as input the results of an SQL one-to-many join, along with a description of the key fields in each level, and outputs the results in a nested JSON object. So for an example, an output of a customer <= invoices <= invoice_detail would have an array of objects containing customer info, each which has an array of child objects one for each invoice, and the invoice objects have a child object array for each line item.
Would be nice if it was abstracted enough to work with any database driver, and also have bindings for the node Oracle, Postgres, and MySQL drivers.
- natalyarostova 8y agoI think you could do this very easily using the Pandas API in Python.