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

数据库存储array list和string的转换 #36

Open
PiuQiuPiaQia opened this issue Jan 17, 2021 · 1 comment
Open

数据库存储array list和string的转换 #36

PiuQiuPiaQia opened this issue Jan 17, 2021 · 1 comment
Labels
question Further information is requested

Comments

@PiuQiuPiaQia
Copy link

如果给ts定义number list,装饰器定义varchar,在service是可以解析到变量有两种类型。
但是在model当前文件是解析不到的。
image
image
即使在上述支持的情况下,转换数据类型也是会被ts捕捉的,毕竟split不存在于number list中。
这种涉及序列化的场景,有什么好的解决方案吗,我看了案例中的转换,属于强转,感觉与any无异。

@tkvern
Copy link
Member

tkvern commented Jan 18, 2021

其实最好的是数据库的字段类型,与Model声明的类型一致。

@tkvern tkvern added the question Further information is requested label Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants