0.0.2 • Published 3 years ago

lb2-runsql v0.0.2

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
3 years ago

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