Skip to content

bypass loopback2's orm; directly run sql against an sql backed datasource

License

Notifications You must be signed in to change notification settings

agokhale/lb2-runsql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

bypass loopback2's orm; directly run sql against an sql backed datasource

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published