是否可以将 sqlite 表嵌套在一起?
是否有可能使用 PDO 在 sqlite 中相互嵌套表?
我是否能够在表 "example"
内的行 "this"
列 "y"
中创建表 "thisExtra"
代码>?
如果可能的话,我将如何去做? 是否会对性能产生严重影响?
我问这个问题的原因是因为我习惯从 xml 文件访问数据 - 我可以将任何我想要的东西放在我想要的任何地方(当然在合理范围内)
提前致谢!
Is it at all possible to nest tables within each other in sqlite using PDO?
Am i able to create table "thisExtra"
inside table "example"
inside row "this"
at collumn "y"
?
If it is possible, how would i go about doing so?
Would there be any hard-hitting performance implications?
The reason i ask this is because im used to accessing data from xml files - where i can put whatever i want wherever i want (within reason of course)
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不可以。表不是 SQLite 中字段的有效数据类型。您将需要创建与另一个表的关系。
附带说明一下,复杂的 XML 文档不适合分段存储在关系数据库中。你应该考虑尝试一些不同的东西。
No. A table is not a valid datatype for a field in SQLite. You will need to create a relation to another table.
As a side note, complex XML documents do not lend themselves to being stored in a relational database piece-wise. You should consider trying something different.
简短的回答是肯定的。您可以将子表存储为 blob 对象。然而,这就是说这是一个非常非常糟糕的想法。这完全违背了使用关系数据库的目的。并且访问数据将需要大量处理,并且不是最佳的。我有没有提到这是一个坏主意?
Short answer is yes, sort of. You could store your subtables as blob objects. However, that said this is a terrible, terrible idea. It is completely counter to the purpose of using a relational database. And accessing the data would be processing intensive and less than optimal. Did I mention this is a bad idea?