从表格中通过 API 为应用程序读取数据,无需实体/定义。

huangapple go评论55阅读模式
英文:

Reading Data via Api for app from table without entity/definition

问题

我需要从表格"cart"中读取数据以供我的应用程序使用。但是我认为调用api/search/不会起作用,因为"cart"没有实体/定义。据我所知,通过API或脚本无法使用SQL。那么,有没有办法获取这些数据?

我不知道该尝试什么,因为我担心这是不可能的。

英文:

I need to read data from the table cart for my app. But an api/search/ call wouldn't work, I think, because cart has no entity/definition. SQL is not possible via the api or in scripts as far as I know.
So, is there a way to get these data?

I do not know what to try because I am afraid it is not possible.

答案1

得分: 2

不应通过数据库抽象层访问购物车表,因此没有为其定义实体和存储库。实际上,这是为了阻止完全更改购物车表中的数据集。如果更改表中的条目,就会存在违反业务逻辑的风险,因为有多个收集器和处理器依赖于表格内容的完整性。

如果要更改购物车,应该在应用脚本内使用购物车服务

英文:

It is intended that you should not access the cart table via the database abstraction, hence why there is no entity definition and repository for it. In fact it is to discourage altering data sets in the cart table entirely. You'd run the risk of violating the business logic by altering the table entries, when there are multiple collectors and processors relying on the integrity of the tables content.

If you want to alter the cart you should use the cart service inside app scripts instead.

huangapple
  • 本文由 发表于 2023年2月16日 17:25:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/75470167.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定