lb2-runsql

0.0.2 • Public • Published

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

Package Sidebar

Install

npm i lb2-runsql

Weekly Downloads

8

Version

0.0.2

License

BSD-2-Clause

Unpacked Size

3.76 kB

Total Files

5

Last publish

Collaborators

  • ashfixit