| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
原始链接: https://news.ycombinator.com/item?id=39417503
围绕使用 SQL 操作 CSV/TSV 数据的讨论强调了实现类似概念的可能性,该概念允许使用 SQL 命令查询 CSV/TSV 文件。 这种方法消除了对传统数据库中常见的额外数据结构的需求,为较小的数据集提供了灵活性。 然而,也有一些限制需要考虑,包括缺乏结构化模式、由于并发更新而难以管理不一致的数据、对高级查询功能的支持有限以及现有工具的潜在冗余。 相比之下,像 SQLite 这样成熟且经过验证的数据库可以为更复杂的数据管理需求提供改进的功能,尽管它在大小限制、读/写能力和同步挑战方面引入了不同的权衡。 最终,这些方法之间的选择取决于具体的要求和偏好。
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
If this is posted by the author looking for feedback:
1) WebDAV is a much better choice than FUSE. FUSE is a good concept, but buggy and poorly-implemented. Things like sshfs can break in very bad ways if e.g. there is a network connectivity issue. Not a hack.
2) Writes seem like a very bad idea. Keep those out unless you come up with a clean way to handle them (which seems difficult if not impossible given the differences in FS versus relational abstractions, especially with regards to data validation). Not a limitation.
In other words, the "hacks" seem like design choices a good architect would likely have made. Continuing:
3) The major use-case I have is if I have a small (
4) I think a major theoretical question is how to fuse the two models. I would like to be able to do 'generic' things like the above on databases, while still being able to be relational.
5) I don't have an answer to the above, but perhaps natural first step might be to allow something like queries or virtual tables to sit on the file system:
wddbfs --anonymous --db-path=/path/to/an/example/database/like/Chinook_Sqlite.sqlite
wddbfs_query myjoin "SELECT * FROM table_1, table_2 WHERE table_1.id=table_2.id"
And voila! A /virtual/myjoin.csv file pops up.
(Even more) half-baked thoughts:
There might be more clever ways to do it too. I'm thinking through half-baked thoughts on how to make files and tab completion work. My half-baked thoughts are moving towards something like:
wddbfs_SELECT * from Customer.tsv\, Employee.tsv WHERE
But I don't like all the potential bugs with escaping. I'm also thinking about when output wants to go to the console versus into a virtual table.
reply