model - Native SQL in StrongLoop Loopback Server -


i have situation model in database not match model in api. specifically, products' api contains contract price, in separate table, , table has price specific each customer/product combination.

outside of strongloop, typically solve custom/native sql, read in documentation such ill advised in strongloop. have other situations database model not efficiently represent api model, typically due legacy data definitions in databases.

  1. should go down path of custom/native sql anyway?
  2. if so, there examples and/or best practices should follow?
  3. if not, other ways should solve problem?

it possible run native sql query in case, work issue. however, not warning on documentation page native sql docs here

this feature has not been tested , not officially supported: api may change in future releases. in general, better perform database actions through connected models. directly executing sql may lead unexpected results, corrupted data, , other issues.

you can find example of similar situation in previous question asked here:

execute raw query on mysql loopback connector


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -