lb2-runsql
v0.0.2
Published
run sql directly on loopback2 sql backed datasources
Downloads
21
Readme
lb2-runsql
bypass loopback2's orm; directly run sql against an sql backed datasource
gifting this antipattern to the future use this to bypass the loopback2 orm allowing one to run things like distinct and group queries pass in any model that's backed by an sql datasource and a query
use this like: const foo = await lb2-runsql.run( <your_lb_model_here>, "select 1" ) .catch (err =>{ debug("runsql", err )}) ;
will return an array of rows with cooked keys eg [ {"colname": "colvalue"}....}
XXXX this is a terrible idea; don't use it