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.
- should go down path of custom/native sql anyway?
- if so, there examples and/or best practices should follow?
- 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:
Comments
Post a Comment