Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

apijson是否支持及联删除 #716

Open
lindaifeng opened this issue May 11, 2024 · 4 comments
Open

apijson是否支持及联删除 #716

lindaifeng opened this issue May 11, 2024 · 4 comments

Comments

@lindaifeng
Copy link
Contributor

Description

你好,请问一下apijson是否支持及联删除呢,目前我看到文档或提问中没有这快的介绍,向有外键约束的数据,则无法正常删除

@TommyLemon
Copy link
Collaborator

TommyLemon commented May 12, 2024

支持任意层级嵌套(当然默认有限制,可以改配置),可以做到删除评论时附带删除它的子评论等功能,参考 Request 表 DELETE Comment 的配置。
不过出于安全考虑,不支持递归,这种在一个项目中数量占比极低的特殊需求可以写远程函数或者单独写一个接口实现。

@lindaifeng
Copy link
Contributor Author

谢谢你的解答,我还有一个疑问想请教您,我希望使用apijson一次请求往多张不同的表中插入数据,我应该怎么操作,我看到相关issues中有提到使用事物来解决,但提供的语法格式却各不相同(尝试未成功),我目前使用的版本是6.3.0,能否提供相关的请求格式供参考,再次感谢

@lindaifeng
Copy link
Contributor Author

比如说,我有一张角色表,菜单表,角色与菜单关联表,我应该如何插入,且自动生成关联表数据

@TommyLemon
Copy link
Collaborator

TommyLemon commented May 18, 2024

正常写多张表对应的多个对象关联插入就行了,甚至从 6.0 开始还支持一次请求对不同的表用不同的 增、删、改、查 操作,感谢 @cloudAndMonkey 的贡献~
#468 (comment)
image

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants