Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

可以隔离数据库吗?直接暴露前端数据库不是很合适 #102

Open
xihu69 opened this issue Jul 28, 2019 · 3 comments
Open

可以隔离数据库吗?直接暴露前端数据库不是很合适 #102

xihu69 opened this issue Jul 28, 2019 · 3 comments
Assignees
Labels

Comments

@xihu69
Copy link

@xihu69 xihu69 commented Jul 28, 2019

具体说下
希望完善对象映射,暴露给前端是对象查询,而不是数据库查询;
类似odata这种;
为什么
1.数据库字段暴露本身比较危险,
2.其次数据库命名并不符合数据获取,虽然可以as,但不能指望前端去做数据库方面东西
3.很多时候前端是不能接触后端数据表的
4.有些字段是需要权限控制的

@TommyLemon
Copy link
Member

@TommyLemon TommyLemon commented Aug 2, 2019


目前提供了 表映射 功能,考虑提供 字段映射。
目前可以重写 SQLConfig.getColumnString 和 SQLExecutor.onPutColumn,把前端传的 字段映射为数据库表的真实字段。

@xihu69
Copy link
Author

@xihu69 xihu69 commented Aug 2, 2019

@TommyLemon
感谢回复,
SQLConfig.getColumnString 可以替换查询列名称,但想分组、排序类的都要重新对应方法把?
有类似getDbColumnName(field) 的方法就好了

@TommyLemon
Copy link
Member

@TommyLemon TommyLemon commented Aug 2, 2019

@xihu69 对的,感谢建议,确实可以封装一个

@TommyLemon TommyLemon self-assigned this Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.