英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论